Burnmydays Claude Opus 4.8 (1M context) commited on
Commit
cb65a60
·
1 Parent(s): 17f5164

feat: redesign UI (bdemo2) — two-column tabs, visible primary path, ghost cards

Browse files

- Leaderboard: board (left) + sticky Operator Profile Inspector (right). Rank-by
styled as a horizontal pill control via CSS (no more gray form box).
- Clock Your Signal: primary local importer up top in a gr.Code block (copy
button, plain URL — fixes the zsh paste trap); advanced/paste options folded
into an accordion; two-column ingest + "minted card" floor.
- Ghost "UNMINTED" placeholder card so the right column is never an empty void.
- Hero: terminal-style copy + Build-Small compute-footprint flex line.
- theme.py: CSS for footprint, pill radio, dark clone block, dropdown, ghost card.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files changed (2) hide show
  1. app.py +70 -64
  2. theme.py +26 -0
app.py CHANGED
@@ -328,6 +328,18 @@ def view_operator(name):
328
  import os as _os
329
  _ON_SPACE = bool(_os.environ.get("SPACE_ID"))
330
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  def _build_demo():
332
  _blocks_kw = {"title": "MO\u00a7ES SigRank"}
333
  try:
@@ -342,79 +354,74 @@ def _build_demo():
342
  with _b:
343
  with gr.Column(elem_id="moses-hero"):
344
  gr.HTML("<h1>MO\u00a7ES\u2122 SigRank</h1>"
345
- "<p>the diagnostic x-ray of the token economy \u00b7 ranked by \u03a5 (Net Volumetric Yield) \u00b7 volume can't buy rank</p>")
346
  gr.HTML('<div id="moses-stat-strip">'
347
- f'<div>operators ranked <span>{len(_ops_now)}</span></div>'
348
- f'<div>MO\u00a7ES leads by <span>{_lead:,.0f}\u00d7</span></div>'
349
- '<div>architecture beats budget</div>'
350
  '</div>')
 
 
351
 
 
352
  with gr.Tab("Leaderboard"):
353
  gr.Markdown("Ranked by **\u03a5 = (Cache\u00b7Output)/Input\u00b2**. Raw Read\u00b7Create\u00b7In\u00b7Out stacked under each operator. $/1M is blended cost \u2014 efficient architecture is also the cheapest.")
354
- rank_by = gr.Radio(list(SORT_LABELS.keys()), value="\u03a5 yield",
355
- label="Rank by \u2014 pick a column to see its leaders")
356
- lb = gr.HTML(board_html())
357
- rank_by.change(resort_board, rank_by, lb)
358
- gr.Markdown("*Corpus is curated \u2014 pasting your usage scores you live against the field but doesn't add you to the persisted board unless you're signed in via HuggingFace. $/1M is a list-price recompute (~); real cost shows when you paste your own ccusage. * = structural estimation.*", elem_id="moses-foot")
359
-
360
- gr.Markdown("### Operator profiles")
361
- op_pick = gr.Dropdown(_names, label="Open an operator's profile", value=None)
362
- op_prof = gr.Markdown(elem_id="moses-profile")
363
- op_card = gr.HTML()
364
- op_pick.change(view_operator, op_pick, [op_prof, op_card])
365
-
 
 
 
 
366
  with gr.Tab("Clock Your Signal"):
367
- gr.Markdown("""### Clock your signal \u2014 local-first
368
-
369
- **\u2460 Get the importer, then run it (the real path).** Paste these three lines into your
370
- terminal \u2014 clone it once, then run it. No install step; it runs on your system Python +
371
- [Node](https://nodejs.org):
372
- ```
373
- git clone https://github.com/SunrisesIllNeverSee/moses-sigrank
374
- cd moses-sigrank
375
- ./sigrank
376
- ```
377
- `./sigrank --codex` for Codex \u00b7 `./sigrank --all` for both. It reads your usage on your
378
- machine and prints your profile + \u03a5 + board rank. **Nothing leaves your computer.**
379
-
380
- **\u2461 No terminal? Paste instead (the backup).** Run one of these, copy the JSON, drop it
381
- in the box below:
382
  ```
383
  npx ccusage@latest claude --json
384
  ```
385
  ```
386
  npx ccusage@latest codex --json
387
  ```
388
- \u26a0\ufe0f Run Claude and Codex **separately** \u2014 never bare `ccusage --json` (it merges every
389
- agent and distorts the read). No JSON? Type four numbers: `input output cache_create cache_read`.
390
-
391
- **\u2462 Read your profile** \u2014 archetype, cascade, full metrics, and your live board placement
392
- appear right below.
393
-
394
- **\u2463 (optional) Sign in with HuggingFace** to save your entry + session history. Without
395
- login it's a live snapshot only.
396
-
397
- *Codex input is estimated (`*`): alone \u2192 AA 2:1 baseline; with a Claude profile \u2192 your own
398
- Claude input:output ratio.*""")
399
- if _ON_SPACE:
400
- gr.LoginButton(elem_id="hf-login-btn")
401
- else:
402
- gr.Markdown("*HuggingFace login available on the hosted Space \u2014 local mode is transient.*", elem_id="moses-foot")
403
- nm = gr.Textbox(label="operator name", placeholder="your handle", max_lines=1)
404
- blob = gr.Textbox(label="ccusage JSON (any provider) \u2014or\u2014 four numbers (I O C R)", lines=6,
405
- placeholder='Paste ccusage claude/codex/combined --json output here\n\nor four numbers: input output cache_create cache_read\n\nExample: 1251211 11296121 128196310 2555179769')
406
- go = gr.Button("Clock My Signal", variant="primary", elem_id="compute-btn")
407
- prof = gr.Markdown(elem_id="moses-profile")
408
- prof_bar = gr.HTML()
409
- gr.Markdown("### share card")
410
- card = gr.HTML()
411
- gr.Markdown("*Screenshot to share \u00b7 right-click \u2192 Save image*", elem_id="moses-foot")
412
- gr.Markdown("### greatest hits")
413
- hits = gr.HTML()
414
- gr.Markdown("*Top sessions by \u03a5 \u2014 sign in with HuggingFace to track your history.*", elem_id="moses-foot")
415
- gr.Markdown("### your placement")
416
- gr.Markdown("*Live placement against the curated field \u2014 sign in to persist your entry.*", elem_id="moses-foot")
417
- ob = gr.HTML(board_html())
418
  go.click(run_ingest, [blob, nm], [prof, prof_bar, card, hits, ob])
419
  gr.Examples(
420
  examples=[
@@ -424,9 +431,8 @@ Claude input:output ratio.*""")
424
  ],
425
  inputs=[blob, nm])
426
 
427
- gr.Markdown(elem_id="moses-foot", value="""Four integers in, full ledger out.
428
- Architecture is the only variable that matters.
429
- Wild-corpus values provisional \u00b7 MO\u00a7ES row verified ccusage \u00b7 * = structural estimation \u00b7 [How it works \u2197](#)""")
430
  return _b
431
 
432
  demo = _build_demo()
 
328
  import os as _os
329
  _ON_SPACE = bool(_os.environ.get("SPACE_ID"))
330
 
331
+ # Ghost/"unminted" card so the right column is never an empty void on first load.
332
+ CARD_PLACEHOLDER = (
333
+ '<div class="sig-card rarity-common" id="ghost-card">'
334
+ '<div class="sig-card-watermark">MO§ES™ SIGRANK</div>'
335
+ '<div class="sig-card-rarity rarity-common">UNMINTED</div>'
336
+ '<div class="sig-card-name">Awaiting Operator…</div>'
337
+ '<div class="sig-card-archetype">Signal Offline</div>'
338
+ '<div class="sig-card-yield">0,000</div>'
339
+ '<div class="sig-card-yield-label">insert token ledger to scan</div>'
340
+ '</div>'
341
+ )
342
+
343
  def _build_demo():
344
  _blocks_kw = {"title": "MO\u00a7ES SigRank"}
345
  try:
 
354
  with _b:
355
  with gr.Column(elem_id="moses-hero"):
356
  gr.HTML("<h1>MO\u00a7ES\u2122 SigRank</h1>"
357
+ "<p>The diagnostic x-ray of the token economy // ranked by \u03a5 (Net Volumetric Yield) // volume can't buy rank</p>")
358
  gr.HTML('<div id="moses-stat-strip">'
359
+ f'<div>OPERATORS RANKED <span>{len(_ops_now)}</span></div>'
360
+ f'<div>MO\u00a7ES LEADS BY <span>{_lead:,.0f}\u00d7</span></div>'
361
+ '<div>ARCHITECTURE BEATS BUDGET</div>'
362
  '</div>')
363
+ gr.HTML('<div id="moses-footprint">compute footprint \u00b7 0.5B params (MiniCPM4-0.5B) \u00b7 '
364
+ 'non-blocking deterministic fallback \u00b7 ZeroGPU \u00b7 \u03a5 = (Cache\u00b7Output)/Input\u00b2</div>')
365
 
366
+ # ---- TAB 1: Leaderboard (board + sticky profile inspector) ----
367
  with gr.Tab("Leaderboard"):
368
  gr.Markdown("Ranked by **\u03a5 = (Cache\u00b7Output)/Input\u00b2**. Raw Read\u00b7Create\u00b7In\u00b7Out stacked under each operator. $/1M is blended cost \u2014 efficient architecture is also the cheapest.")
369
+ with gr.Row():
370
+ with gr.Column(scale=7):
371
+ rank_by = gr.Radio(list(SORT_LABELS.keys()), value="\u03a5 yield",
372
+ label="Rank by", elem_id="rank-by")
373
+ lb = gr.HTML(board_html())
374
+ rank_by.change(resort_board, rank_by, lb)
375
+ gr.Markdown("*Curated corpus \u00b7 pasting scores you live but isn't persisted unless you sign in \u00b7 $/1M is a list-price recompute (~) \u00b7 \\* = structural estimation.*", elem_id="moses-foot")
376
+ with gr.Column(scale=5):
377
+ gr.Markdown("### Operator profile inspector")
378
+ op_pick = gr.Dropdown(_names, label="Select an operator to pull their card",
379
+ value=None, elem_id="op-pick")
380
+ op_card = gr.HTML(CARD_PLACEHOLDER)
381
+ op_prof = gr.Markdown(elem_id="moses-profile")
382
+ op_pick.change(view_operator, op_pick, [op_prof, op_card])
383
+
384
+ # ---- TAB 2: Clock Your Signal (primary importer up top, then ingest + card) ----
385
  with gr.Tab("Clock Your Signal"):
386
+ gr.Markdown("### Primary path \u2014 run the local importer")
387
+ gr.Markdown("Reads your usage on your own machine. **Nothing leaves your computer.** Clone it once, then run:")
388
+ gr.Code(value="git clone https://github.com/Burnmydays/hf-\ncd hf-\n./sigrank",
389
+ language="shell", show_label=False, elem_id="clone-code")
390
+ with gr.Accordion("More options \u2014 Codex, all providers, or paste instead", open=False):
391
+ gr.Markdown("""`./sigrank --codex` reads Codex usage \u00b7 `./sigrank --all` runs every provider in turn.
392
+
393
+ **No terminal? Paste instead (the backup).** Run one of these, copy the JSON, drop it in the box below:
 
 
 
 
 
 
 
394
  ```
395
  npx ccusage@latest claude --json
396
  ```
397
  ```
398
  npx ccusage@latest codex --json
399
  ```
400
+ \u26a0\ufe0f Run Claude and Codex **separately** \u2014 never bare `ccusage --json` (it merges every agent and distorts the read). No JSON? Type four numbers: `input output cache_create cache_read`.
401
+
402
+ *Codex input is estimated (\\*): alone \u2192 AA 2:1 baseline; with a Claude profile \u2192 your own Claude input:output ratio.*""")
403
+ gr.HTML("<hr style='border:0;border-top:1px solid var(--moses-line);margin:18px 0;'>")
404
+ with gr.Row():
405
+ with gr.Column(scale=5):
406
+ gr.Markdown("### Ingest a signal")
407
+ if _ON_SPACE:
408
+ gr.LoginButton(elem_id="hf-login-btn")
409
+ else:
410
+ gr.Markdown("*HuggingFace login available on the hosted Space \u2014 local mode is transient.*", elem_id="moses-foot")
411
+ nm = gr.Textbox(label="operator name / handle", placeholder="your handle", max_lines=1)
412
+ blob = gr.Textbox(label="ccusage JSON \u2014or\u2014 four numbers (I O C R)", lines=5,
413
+ placeholder='Paste ccusage JSON here\n\nor four numbers: input output cache_create cache_read\n\nExample: 1251211 11296121 128196310 2555179769')
414
+ go = gr.Button("Clock My Signal", variant="primary", elem_id="compute-btn")
415
+ gr.Markdown("### Your live board placement")
416
+ ob = gr.HTML(board_html())
417
+ gr.Markdown("### Greatest hits")
418
+ hits = gr.HTML()
419
+ with gr.Column(scale=6):
420
+ gr.Markdown("### Minted operator card")
421
+ card = gr.HTML(CARD_PLACEHOLDER)
422
+ gr.Markdown("*Right-click \u2192 Save image to share your architectural footprint.*", elem_id="moses-foot")
423
+ prof_bar = gr.HTML()
424
+ prof = gr.Markdown(elem_id="moses-profile")
 
 
 
 
 
425
  go.click(run_ingest, [blob, nm], [prof, prof_bar, card, hits, ob])
426
  gr.Examples(
427
  examples=[
 
431
  ],
432
  inputs=[blob, nm])
433
 
434
+ gr.Markdown(elem_id="moses-foot", value="""Four integers in, full ledger out. Architecture is the only variable that matters.
435
+ Wild corpus: tokscale.ai footprints \u00b7 MO\u00a7ES row verified ccusage \u00b7 * = structural estimation.""")
 
436
  return _b
437
 
438
  demo = _build_demo()
theme.py CHANGED
@@ -200,6 +200,32 @@ button.primary:hover, #compute-btn:hover { background: #d8a449 !important; }
200
  /* HF login button styling */
201
  #hf-login-btn { margin-bottom: 8px; }
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  footer { display: none !important; }
204
 
205
  @media (max-width: 700px) {
 
200
  /* HF login button styling */
201
  #hf-login-btn { margin-bottom: 8px; }
202
 
203
+ /* footprint flex line under the hero (Build Small badge) */
204
+ #moses-footprint { margin-top: 8px; font-size: 10px; color: var(--moses-dim);
205
+ letter-spacing: 0.05em; opacity: 0.85; }
206
+
207
+ /* "Rank by" radio -> horizontal pill / segmented control (not a gray form) */
208
+ #rank-by { border: none !important; background: transparent !important; padding: 0 !important; }
209
+ #rank-by .wrap { display: flex !important; flex-wrap: wrap; gap: 6px; }
210
+ #rank-by .wrap label {
211
+ background: var(--moses-card); border: 1px solid var(--moses-line);
212
+ border-radius: 16px; padding: 4px 12px; color: var(--moses-dim);
213
+ font-size: 11px; cursor: pointer; margin: 0 !important; }
214
+ #rank-by .wrap label.selected, #rank-by .wrap label:has(input:checked) {
215
+ border-color: var(--moses-gold) !important; color: var(--moses-gold) !important;
216
+ background: rgba(196,146,58,0.12) !important; }
217
+ #rank-by input[type="radio"] { display: none !important; }
218
+
219
+ /* primary-path clone code block — match the dark terminal */
220
+ #clone-code, #clone-code * { background: var(--moses-bg) !important; color: var(--moses-ink) !important; }
221
+ #clone-code { border: 1px solid var(--moses-line) !important; border-radius: 8px !important; }
222
+
223
+ /* operator picker dropdown */
224
+ #op-pick input { background: var(--moses-bg) !important; color: var(--moses-ink) !important; }
225
+
226
+ /* ghost / unminted placeholder card */
227
+ #ghost-card { opacity: 0.45; border-style: dashed !important; }
228
+
229
  footer { display: none !important; }
230
 
231
  @media (max-width: 700px) {