Burnmydays Devin AI Deric J. McHenry commited on
Commit
1dd3713
·
unverified ·
2 Parent(s): d30f28f751258e

Merge pull request #3 from Burnmydays/devin/1781533476-rarity-system

Browse files

- Add rarity_class(m) mapping velocity/leverage to four tiers
- card_html(): rarity badge, passive ability, effect text, per-rarity border
- board_html(): rarity-colored left borders per row
- theme.py: rarity CSS variables, card variants, badge/passive/effect styles
- .sig-card-name defaults to --moses-ink; MYTHIC overrides to gold

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Deric J. McHenry <deric.mchenry@gmail.com>

Files changed (3) hide show
  1. SCRATCHPAD.md +17 -0
  2. app.py +38 -2
  3. theme.py +22 -3
SCRATCHPAD.md CHANGED
@@ -40,6 +40,23 @@ cd /Users/dericmchenry/Desktop/moses-sigrank
40
 
41
  ## WORK LOG (newest first)
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ### Devin session — 2026-06-15 (visual upgrade)
44
  - [done] theme.py CSS upgrade — brighter default bar gradient (0.28→0.72), `.mb-row.rank1`
45
  gold left-border + dominant #1 row, colored rank numbers (`.mb-rank-1/2/3`), hero upgrade
 
40
 
41
  ## WORK LOG (newest first)
42
 
43
+ ### Devin session — 2026-06-15 (rarity system)
44
+ - [done] `rarity_class(m)` function added after `classify()` — maps velocity/leverage axes to
45
+ four tiers: MYTHIC (v≥1, l≥100), EPIC (l≥10, v<1), RARE (v≥0.5), COMMON (fallback).
46
+ Each tier returns (key, label, passive ability name, effect flavor text).
47
+ - [done] `card_html()` updated — outer `.sig-card` div gets `rarity-{key}` class, new
48
+ `.sig-card-rarity` badge (COMMON/RARE/EPIC/MYTHIC), `.sig-card-passive` + `.sig-card-effect`
49
+ blocks inserted between archetype and yield. All existing elements preserved.
50
+ - [done] `board_html()` updated — each row gets `rarity-{key}` class for colored left-border.
51
+ - [done] `theme.py` CSS — rarity color variables (`--rarity-common/rare/epic/mythic`), board
52
+ row `.mb-row.rarity-*` left-borders, `.sig-card` hardcoded gold border removed (now per-rarity
53
+ border + box-shadow), `.sig-card-rarity` badge styles, `.sig-card-passive`/`.sig-card-effect`
54
+ text styles, `.sig-card-name` color changed to `--moses-ink` (rarity border carries signal),
55
+ MYTHIC override for yield/name color to gold.
56
+ - [done] Verify green: `py_compile` all *.py OK · `metrics.py` canonical (Y 18436.98, lev 2042.2,
57
+ 10xDEV 3.31, $/1M 0.527) · rarity assignments: MO§ES→MYTHIC, MapleEve/vincentkoc→EPIC,
58
+ cexll/iamtheavoc1→RARE, Nepomuk5665/kzquandary→COMMON.
59
+
60
  ### Devin session — 2026-06-15 (visual upgrade)
61
  - [done] theme.py CSS upgrade — brighter default bar gradient (0.28→0.72), `.mb-row.rank1`
62
  gold left-border + dominant #1 row, colored rank numbers (`.mb-rank-1/2/3`), hero upgrade
app.py CHANGED
@@ -60,7 +60,13 @@ def board_html(extra=None):
60
  barpct=max(2,100*(1-orders/5))
61
  d=f"{m['dev10x']:.2f}" if m['dev10x'] is not None else "\u2014"
62
  rank_cls = f"mb-rank-{i}" if i <= 3 else ""
63
- cls = "mb-row you" if you else ("mb-row rank1" if i==1 else "mb-row")
 
 
 
 
 
 
64
  ne = _html.escape(n)
65
  est_mark = " <span class='mb-est' title='estimated (Codex anchor)'>~</span>" if m.get("cost_estimated") else ""
66
  out.append(f'<div class="{cls}">'
@@ -87,6 +93,32 @@ def classify(m):
87
  if v>=0.8 and l<2: return "Volatile Ingestor \u00b7 generates, doesn't retain"
88
  return "Transient \u00b7 low on both axes"
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  def comp_bar_html(c):
91
  return (f'<div class="comp-bar">'
92
  f'<div class="comp-read" style="width:{c["read"]:.1f}%"></div>'
@@ -108,6 +140,7 @@ def _first_sentence(text, limit=120):
108
 
109
  def card_html(name, m, rank, total_ops, narration_text):
110
  archetype = classify(m).split("\u00b7")[0].strip()
 
111
  c = m["composition"]
112
  if m["transmission"] is not None:
113
  cascade = (
@@ -123,10 +156,13 @@ def card_html(name, m, rank, total_ops, narration_text):
123
  cascade = '<div class="sig-card-cascade-box">\u2014<small>non-compounding</small></div>'
124
  quote = _first_sentence(narration_text)
125
  return (
126
- '<div class="sig-card">'
127
  '<div class="sig-card-watermark">MO\u00a7ES\u2122 SIGRANK</div>'
 
128
  f'<div class="sig-card-name">{name}</div>'
129
  f'<div class="sig-card-archetype">{archetype}</div>'
 
 
130
  f'<div class="sig-card-yield">{m["yield"]:,.0f}</div>'
131
  '<div class="sig-card-yield-label">net volumetric yield</div>'
132
  f'<div class="sig-card-rank">#<span>{rank}</span> of {total_ops} operators</div>'
 
60
  barpct=max(2,100*(1-orders/5))
61
  d=f"{m['dev10x']:.2f}" if m['dev10x'] is not None else "\u2014"
62
  rank_cls = f"mb-rank-{i}" if i <= 3 else ""
63
+ rkey = rarity_class(m)[0]
64
+ if you:
65
+ cls = f"mb-row rarity-{rkey} you"
66
+ elif i == 1:
67
+ cls = f"mb-row rarity-{rkey} rank1"
68
+ else:
69
+ cls = f"mb-row rarity-{rkey}"
70
  ne = _html.escape(n)
71
  est_mark = " <span class='mb-est' title='estimated (Codex anchor)'>~</span>" if m.get("cost_estimated") else ""
72
  out.append(f'<div class="{cls}">'
 
93
  if v>=0.8 and l<2: return "Volatile Ingestor \u00b7 generates, doesn't retain"
94
  return "Transient \u00b7 low on both axes"
95
 
96
+ def rarity_class(m):
97
+ """Returns (rarity_key, label, passive, effect).
98
+ MYTHIC > EPIC > RARE > COMMON based on velocity/leverage axes.
99
+ Mirrors the user's trading-card design: four species of greatness.
100
+ """
101
+ v, l = m["velocity"], m["leverage"]
102
+ if v >= 1 and l >= 100:
103
+ return ("mythic", "MYTHIC",
104
+ "Compound Interest",
105
+ "Multipliers stack. Transmission \u00d7 Commitment \u00d7 Reuse = Leverage. "
106
+ "The rare operator the leverage/generation tradeoff says shouldn\u2019t exist.")
107
+ if l >= 10 and v < 1:
108
+ return ("epic", "EPIC",
109
+ "Persistent Memory",
110
+ "Builds reusable structures. Each cache write is read many times. "
111
+ "Holds context beautifully \u2014 the architecture compounds without the velocity.")
112
+ if v >= 0.5:
113
+ return ("rare", "RARE",
114
+ "Direct Production",
115
+ "Strong input-to-output conversion. Fast on single shots. "
116
+ "Memory doesn\u2019t persist into a compounding loop.")
117
+ return ("common", "COMMON",
118
+ "Mass Transit",
119
+ "Moves enormous token mass. Volume is the strategy. "
120
+ "Amplification is not the goal \u2014 scale is.")
121
+
122
  def comp_bar_html(c):
123
  return (f'<div class="comp-bar">'
124
  f'<div class="comp-read" style="width:{c["read"]:.1f}%"></div>'
 
140
 
141
  def card_html(name, m, rank, total_ops, narration_text):
142
  archetype = classify(m).split("\u00b7")[0].strip()
143
+ rkey, rlabel, passive, effect = rarity_class(m)
144
  c = m["composition"]
145
  if m["transmission"] is not None:
146
  cascade = (
 
156
  cascade = '<div class="sig-card-cascade-box">\u2014<small>non-compounding</small></div>'
157
  quote = _first_sentence(narration_text)
158
  return (
159
+ f'<div class="sig-card rarity-{rkey}">'
160
  '<div class="sig-card-watermark">MO\u00a7ES\u2122 SIGRANK</div>'
161
+ f'<div class="sig-card-rarity rarity-{rkey}">{rlabel}</div>'
162
  f'<div class="sig-card-name">{name}</div>'
163
  f'<div class="sig-card-archetype">{archetype}</div>'
164
+ f'<div class="sig-card-passive">Passive: {passive}</div>'
165
+ f'<div class="sig-card-effect">{effect}</div>'
166
  f'<div class="sig-card-yield">{m["yield"]:,.0f}</div>'
167
  '<div class="sig-card-yield-label">net volumetric yield</div>'
168
  f'<div class="sig-card-rank">#<span>{rank}</span> of {total_ops} operators</div>'
theme.py CHANGED
@@ -8,6 +8,10 @@ CSS = """
8
  --moses-line: #3A3324;
9
  --moses-ink: #E8E0CF;
10
  --moses-dim: #8a7f68;
 
 
 
 
11
  }
12
  .gradio-container, .gradio-container * { font-family: ui-monospace, "SF Mono", Menlo, monospace !important; }
13
  .gradio-container { background: var(--moses-bg) !important; max-width: 1100px !important; margin: 0 auto !important; }
@@ -84,6 +88,10 @@ button.primary:hover, #compute-btn:hover { background: #d8a449 !important; }
84
  color: var(--moses-ink) !important;
85
  }
86
  .mb-row.rank1 .mb-yval { color: var(--moses-gold); font-size: 14px; }
 
 
 
 
87
  .mb-rank-1 { color: var(--moses-gold); font-weight: 700; }
88
  .mb-rank-2 { color: #a0a0a0; }
89
  .mb-rank-3 { color: #8a6a3a; }
@@ -108,18 +116,20 @@ button.primary:hover, #compute-btn:hover { background: #d8a449 !important; }
108
  .sig-card {
109
  width: 380px; min-height: 500px;
110
  background: linear-gradient(160deg, #1E1B15 60%, #2a2318);
111
- border: 1px solid var(--moses-gold);
112
  border-radius: 12px;
113
  padding: 28px 24px 20px;
114
  font-family: ui-monospace, monospace;
115
  position: relative;
116
- box-shadow: 0 0 40px rgba(196,146,58,0.12), inset 0 1px 0 rgba(196,146,58,0.2);
117
  }
 
 
 
 
118
  .sig-card-watermark {
119
  position: absolute; top: 14px; right: 16px;
120
  font-size: 9px; color: var(--moses-dim); letter-spacing: 0.1em;
121
  }
122
- .sig-card-name { color: var(--moses-gold); font-size: 22px; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 4px; }
123
  .sig-card-archetype {
124
  display: inline-block; font-size: 10px; letter-spacing: 0.08em;
125
  border: 1px solid var(--moses-gold); color: var(--moses-gold);
@@ -145,6 +155,15 @@ button.primary:hover, #compute-btn:hover { background: #d8a449 !important; }
145
  padding: 8px 12px; margin-top: 16px; line-height: 1.5;
146
  font-style: italic;
147
  }
 
 
 
 
 
 
 
 
 
148
  .sig-card-footer {
149
  position: absolute; bottom: 16px; left: 24px; right: 24px;
150
  font-size: 9px; color: #5f573f; letter-spacing: 0.06em;
 
8
  --moses-line: #3A3324;
9
  --moses-ink: #E8E0CF;
10
  --moses-dim: #8a7f68;
11
+ --rarity-common: #6b7280;
12
+ --rarity-rare: #3b82f6;
13
+ --rarity-epic: #8b5cf6;
14
+ --rarity-mythic: #C4923A;
15
  }
16
  .gradio-container, .gradio-container * { font-family: ui-monospace, "SF Mono", Menlo, monospace !important; }
17
  .gradio-container { background: var(--moses-bg) !important; max-width: 1100px !important; margin: 0 auto !important; }
 
88
  color: var(--moses-ink) !important;
89
  }
90
  .mb-row.rank1 .mb-yval { color: var(--moses-gold); font-size: 14px; }
91
+ .mb-row.rarity-common { border-left: 3px solid var(--rarity-common); }
92
+ .mb-row.rarity-rare { border-left: 3px solid var(--rarity-rare); }
93
+ .mb-row.rarity-epic { border-left: 3px solid var(--rarity-epic); }
94
+ .mb-row.rarity-mythic { border-left: 3px solid var(--rarity-mythic); }
95
  .mb-rank-1 { color: var(--moses-gold); font-weight: 700; }
96
  .mb-rank-2 { color: #a0a0a0; }
97
  .mb-rank-3 { color: #8a6a3a; }
 
116
  .sig-card {
117
  width: 380px; min-height: 500px;
118
  background: linear-gradient(160deg, #1E1B15 60%, #2a2318);
 
119
  border-radius: 12px;
120
  padding: 28px 24px 20px;
121
  font-family: ui-monospace, monospace;
122
  position: relative;
 
123
  }
124
+ .sig-card.rarity-common { border: 1px solid var(--rarity-common); box-shadow: 0 0 20px rgba(107,114,128,0.12); }
125
+ .sig-card.rarity-rare { border: 1px solid var(--rarity-rare); box-shadow: 0 0 24px rgba(59,130,246,0.15); }
126
+ .sig-card.rarity-epic { border: 1px solid var(--rarity-epic); box-shadow: 0 0 28px rgba(139,92,246,0.18); }
127
+ .sig-card.rarity-mythic { border: 1px solid var(--rarity-mythic); box-shadow: 0 0 40px rgba(196,146,58,0.22), inset 0 1px 0 rgba(196,146,58,0.15); }
128
  .sig-card-watermark {
129
  position: absolute; top: 14px; right: 16px;
130
  font-size: 9px; color: var(--moses-dim); letter-spacing: 0.1em;
131
  }
132
+ .sig-card-name { color: var(--moses-ink); font-size: 22px; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 4px; }
133
  .sig-card-archetype {
134
  display: inline-block; font-size: 10px; letter-spacing: 0.08em;
135
  border: 1px solid var(--moses-gold); color: var(--moses-gold);
 
155
  padding: 8px 12px; margin-top: 16px; line-height: 1.5;
156
  font-style: italic;
157
  }
158
+ .sig-card-rarity { display: inline-block; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; padding: 2px 8px; border-radius: 2px; margin-bottom: 8px; }
159
+ .sig-card-rarity.rarity-common { color: var(--rarity-common); border: 1px solid var(--rarity-common); }
160
+ .sig-card-rarity.rarity-rare { color: var(--rarity-rare); border: 1px solid var(--rarity-rare); }
161
+ .sig-card-rarity.rarity-epic { color: var(--rarity-epic); border: 1px solid var(--rarity-epic); }
162
+ .sig-card-rarity.rarity-mythic { color: var(--rarity-mythic); border: 1px solid var(--rarity-mythic); }
163
+ .sig-card-passive { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--moses-dim); margin: 12px 0 4px; }
164
+ .sig-card-effect { font-size: 10px; color: var(--moses-dim); font-style: italic; border-left: 2px solid #3A3324; padding: 6px 10px; margin-bottom: 14px; line-height: 1.5; }
165
+ .sig-card.rarity-mythic .sig-card-yield { color: var(--rarity-mythic); }
166
+ .sig-card.rarity-mythic .sig-card-name { color: var(--rarity-mythic); }
167
  .sig-card-footer {
168
  position: absolute; bottom: 16px; left: 24px; right: 24px;
169
  font-size: 9px; color: #5f573f; letter-spacing: 0.06em;