|
| 1 | +"""Host-owned navigation and evidence summaries for existing passive layouts.""" |
| 2 | + |
| 3 | +SCRIPT = r""" |
| 4 | +let dashboardTab='overview'; |
| 5 | +const dashboardTabs=[['overview','Overview'],['trades','Trading'],['income','Other income'],['learning','Learning'],['activity','Agents & resources'],['diagnostics','Evidence archive']]; |
| 6 | +function dashboardNavigation(){ |
| 7 | + let nav=document.getElementById('mission-navigation'); |
| 8 | + if(!nav){nav=document.createElement('nav');nav.id='mission-navigation';nav.setAttribute('aria-label','Dashboard sections');for(const [key,label] of dashboardTabs){const b=document.createElement('button');b.textContent=label;b.dataset.tab=key;b.onclick=()=>{dashboardTab=key;dashboardNavigation()};nav.append(b)}document.getElementById('cards').before(nav)} |
| 9 | + const groups={trades:['trade-explorer','backtests','paper'],income:['income-panel','source-panel'],learning:['goal-learning-panel','evaluation'],activity:['resource-panel','agent-panel','plan-panel'],overview:['overview-panel']}; |
| 10 | + for(const n of document.querySelectorAll('body > section, body > details')){let group='diagnostics';for(const [key,ids] of Object.entries(groups))if(ids.some(id=>n.id===id||n.querySelector('#'+id)))group=key;n.hidden=group!==dashboardTab;n.dataset.dashboardGroup=group} |
| 11 | + for(const b of nav.children){b.setAttribute('aria-pressed',String(b.dataset.tab===dashboardTab))} |
| 12 | + const cards=document.getElementById('cards');cards.hidden=dashboardTab!=='overview'; |
| 13 | + // Repair older custom guest tables with four headers but six data columns. |
| 14 | + const table=document.getElementById('backtests')?.closest('table');if(table){let head=table.querySelector('thead');if(!head){head=document.createElement('thead');table.prepend(head)}const tr=document.createElement('tr');for(const title of ['Trial','Net return','Maximum drawdown (peak to trough)','Fills','Triage','Net return at double costs']){const th=document.createElement('th');th.scope='col';th.textContent=title;tr.append(th)}head.replaceChildren(tr)} |
| 15 | +} |
| 16 | +function evidenceBars(parent,title,rows,unit){ |
| 17 | + const h=document.createElement('h3');h.textContent=title;parent.append(h);const usable=rows.filter(r=>typeof r[1]==='number'&&Number.isFinite(r[1]));if(!usable.length){textField(parent,'Status','No measured values available');return} |
| 18 | + const max=Math.max(1,...usable.map(r=>r[1]));for(const [label,value] of usable){const box=document.createElement('div');box.className='evidence-bar';const text=document.createElement('span');text.textContent=label+': '+value.toFixed(unit==='Brier'?4:0)+' '+unit;const track=document.createElement('div');track.className='bar-track';const bar=document.createElement('div');bar.style.width=(value/max*100)+'%';track.append(bar);box.append(text,track);parent.append(box)} |
| 19 | +} |
| 20 | +function insightsView(data){ |
| 21 | + const r=data.report||{},g=r.mission_evidence?.goal_learning||{},policy=g.cpu_shadow_policy||{},work=r.income_work||{},sources=r.source_acquisition||{}; |
| 22 | + const p=panel('overview-panel','What is actually happening',$('cards'));p.replaceChildren();const h=document.createElement('h2');h.textContent='Results, work and learning';p.append(h);textField(p,'Verified revenue','Unavailable: no verified payment ledger connected');textField(p,'Current model-selected work',work.state||'No work receipt in this snapshot');textField(p,'Last work recorded',work.updated?new Date(work.updated*1000).toLocaleString():'unknown');textField(p,'Successful tool receipts in last experiment',work.successful_tool_receipts);textField(p,'Meaning','A source read or a successful process is not a validated experiment, a model update or earned money.');textField(p,'CPU shadow learning',policy.state||'No policy receipt');textField(p,'Verified outcomes used by CPU policy',policy.trained_outcomes);textField(p,'Gemma accepted updates in this run',r.accepted_weight_updates_this_run);textField(p,'Immediate blocker',work.error||r.learning_activity?.reason||r.paper_fee_source?.error||'None recorded in these receipts'); |
| 23 | + detailsField(p,'Last experiment receipt',JSON.stringify(work,null,2),'overview-work'); |
| 24 | + const income=$('income-view');if(income){const counts=new Map();for(const c of r.income_opportunities?.candidates||[]){const name=c.specification?.domain||'Unspecified domain';counts.set(name,(counts.get(name)||0)+1)}evidenceBars(income,'Research coverage by domain (proposals, not earnings)',[...counts],'proposals');evidenceBars(income,'Source acquisition quality',[['Distinct contents',sources.distinct_contents],['Unchanged rereads',sources.unchanged_rereads]],'retrievals');textField(income,'Outcome charts','No verified revenue or completed-test time series for these domains is recorded. Proposal counts and estimated rewards cannot supply a profit curve.');} |
| 25 | + const learning=$('goal-learning-view');if(learning){textField(learning,'CPU policy',policy.state||'unavailable');textField(learning,'Independent outcomes trained',policy.trained_outcomes);textField(learning,'Scored replay predictions',policy.prequential_samples);evidenceBars(learning,'CPU forecast replay comparison: lower Brier is better',[['Learned shadow',policy.prequential_brier],['Uniform reference',policy.prequential_samples>0?policy.uniform_baseline_brier:null],['Always flat',policy.prequential_flat_baseline_brier],['Prior frequency',policy.prequential_frequency_baseline_brier]],'Brier');textField(learning,'Score scope','Exploratory prequential replay on the same scored samples. Not profit, not Gemma training and not proof of a forward advantage.');} |
| 26 | +} |
| 27 | +
|
| 28 | +""" |
| 29 | + |
| 30 | +STYLE = """ |
| 31 | +[hidden]{display:none!important}body{background:#0c1422;max-width:1280px}#mission-navigation{display:flex;gap:8px;flex-wrap:wrap;position:sticky;top:0;z-index:10;padding:12px 0;background:#0c1422;border-bottom:1px solid #304259;margin-bottom:20px}#mission-navigation button{background:#17263c;border:1px solid #304259;color:#bac9de}#mission-navigation button[aria-pressed=true]{background:#29578b;color:#fff;border-color:#85baff}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #ffd166;outline-offset:3px}section{box-shadow:none}h1{letter-spacing:-.6px}#cards{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}#overview-panel{border-left:4px solid #80baff}table{display:block;overflow:auto;white-space:nowrap}th{font-size:12px;color:#b9cbe2}select,input{background:#14243a;color:#eef5ff;border:1px solid #486582;padding:9px;border-radius:7px;max-width:100%}label{display:grid;gap:6px;font-size:13px}.evidence-bar{margin:12px 0;font-size:13px}.bar-track{height:9px;background:#26384e;border-radius:9px;margin-top:6px}.bar-track>div{height:100%;background:#85baff;border-radius:9px}#income-view>.card{margin:8px 0}#backtest-audit{max-height:120px}#fresh,#layout{font-size:12px}#trade-plot{background:#0c1726;border-radius:10px}#trade-summary{font-weight:600}#trade-scope{font-size:12px}#trade-hover{font-size:13px}#timeline-panel{max-height:none}#plan-grid p{max-height:180px;overflow:auto}@media(max-width:650px){#mission-navigation{gap:6px}#mission-navigation button{padding:8px 10px;font-size:12px}} |
| 32 | +""" |
0 commit comments