thomwolf HF Staff commited on
Commit
77e661b
·
verified ·
1 Parent(s): c9c24f2

add live maturity-mismatch flag (developing articles at comprehensive-median depth)

Browse files
Files changed (1) hide show
  1. index.html +27 -1
index.html CHANGED
@@ -73,6 +73,15 @@
73
  b.k{color:var(--ink);font-weight:600}
74
  .loading{color:var(--slate);font-family:var(--mono);font-size:13px;padding:22px 16px}
75
  .muted{opacity:.5}
 
 
 
 
 
 
 
 
 
76
  </style>
77
  </head>
78
  <body>
@@ -95,6 +104,7 @@
95
  <span class="k"><span style="width:2px;height:12px;background:var(--amber);display:inline-block"></span>needs depth</span>
96
  </div>
97
  <div class="ledger" id="ledger"><div class="loading">loading 50 articles…</div></div>
 
98
  </section>
99
 
100
  <section>
@@ -143,7 +153,7 @@ async function main(){
143
  rows.push({path:p.path.replace('topics/','').replace('.md',''),cat:p.parent||'?',maturity:mat,chars:c.length,sources:srcs.size});
144
  }));
145
  }
146
- renderStats(rows); renderLedger(rows);
147
 
148
  let q=[];
149
  try{ q=(await (await fetch(API+'/v1/queue?status=queued&limit=300')).json()).items.filter(i=>i.status==='queued'); }catch(e){}
@@ -183,6 +193,22 @@ function renderLedger(rows){
183
  document.getElementById('ledger').innerHTML=h;
184
  }
185
  const avg=a=>a.reduce((s,r)=>s+r.chars,0)/a.length;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
 
187
  async function renderCites(q){
188
  const el=document.getElementById('citecard');
 
73
  b.k{color:var(--ink);font-weight:600}
74
  .loading{color:var(--slate);font-family:var(--mono);font-size:13px;padding:22px 16px}
75
  .muted{opacity:.5}
76
+ .mm{margin-top:14px;background:var(--panel);border:1px solid var(--hair);border-radius:11px;padding:16px 18px;box-shadow:inset 3px 0 0 var(--teal)}
77
+ .mmhd{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
78
+ .mmt{font-weight:650;font-size:13.5px} .mmt .mono{font-weight:600;color:var(--accent)}
79
+ .mmn{font-size:12px;color:var(--teal);flex:none}
80
+ .mms{font-size:12.5px;color:var(--slate);margin:5px 0 12px;max-width:72ch}
81
+ ul.mml{list-style:none;margin:0;padding:0}
82
+ ul.mml li{display:flex;align-items:baseline;gap:11px;padding:6px 0;border-top:1px solid var(--hair);font-size:13px}
83
+ ul.mml li:first-child{border-top:0}
84
+ .mmc{color:var(--teal);width:74px;flex:none;font-size:12px}
85
  </style>
86
  </head>
87
  <body>
 
104
  <span class="k"><span style="width:2px;height:12px;background:var(--amber);display:inline-block"></span>needs depth</span>
105
  </div>
106
  <div class="ledger" id="ledger"><div class="loading">loading 50 articles…</div></div>
107
+ <div id="mismatch"></div>
108
  </section>
109
 
110
  <section>
 
153
  rows.push({path:p.path.replace('topics/','').replace('.md',''),cat:p.parent||'?',maturity:mat,chars:c.length,sources:srcs.size});
154
  }));
155
  }
156
+ renderStats(rows); renderLedger(rows); renderMismatch(rows);
157
 
158
  let q=[];
159
  try{ q=(await (await fetch(API+'/v1/queue?status=queued&limit=300')).json()).items.filter(i=>i.status==='queued'); }catch(e){}
 
193
  document.getElementById('ledger').innerHTML=h;
194
  }
195
  const avg=a=>a.reduce((s,r)=>s+r.chars,0)/a.length;
196
+ const median=a=>{const s=[...a].sort((x,y)=>x-y);const m=s.length>>1;return s.length%2?s[m]:(s[m-1]+s[m])/2;};
197
+
198
+ function renderMismatch(rows){
199
+ const comp=rows.filter(r=>r.maturity==='comprehensive');
200
+ if(comp.length<4){document.getElementById('mismatch').innerHTML='';return;}
201
+ const mc=median(comp.map(r=>r.chars)), ms=median(comp.map(r=>r.sources));
202
+ const cand=rows.filter(r=>r.maturity==='developing'&&r.chars>=mc&&r.sources>=ms).sort((a,b)=>b.chars-a.chars);
203
+ const el=document.getElementById('mismatch');
204
+ if(!cand.length){el.innerHTML='';return;}
205
+ let h='<div class="mm"><div class="mmhd"><span class="mmt">Maturity mismatch — tagged <span class="mono">developing</span>, but as deep as a median <span class="mono">comprehensive</span> article</span>'
206
+ +'<span class="mmn mono">'+cand.length+' bump candidate'+(cand.length>1?'s':'')+'</span></div>'
207
+ +'<div class="mms">The <span class="mono">maturity</span> field drifts stale as articles grow; these clear the comprehensive median ('
208
+ +Math.round(mc/1000)+'k chars, '+ms+' src) on both axes — read-then-bump candidates, not auto-flips.</div><ul class="mml">';
209
+ for(const r of cand) h+='<li><span class="mono mmc">'+Math.round(r.chars/1000)+'k · '+r.sources+'s</span>'+esc(r.path)+'</li>';
210
+ el.innerHTML=h+'</ul></div>';
211
+ }
212
 
213
  async function renderCites(q){
214
  const el=document.getElementById('citecard');