Add local result download control
Browse files- app.js +5 -0
- index.html +1 -1
app.js
CHANGED
|
@@ -14,6 +14,11 @@
|
|
| 14 |
document.querySelector('#output').innerHTML=`<p><b>${r.strategy}</b></p><p>Current answer: ${r.current||'none'}</p><p>Active records: ${r.records.filter(x=>x.status==='active').length} 路 Superseded: ${r.superseded.length}</p><p>Evidence families counted: ${r.evidence.join(', ')}</p>`;
|
| 15 |
document.querySelector('#comparison').innerHTML='<table><tr><th>Strategy</th><th>Current answer</th><th>Superseded</th></tr>'+MnemosyneCore.strategies.map(x=>{const q=MnemosyneCore.run(x,s);return `<tr><td>${x}</td><td>${q.current||'none'}</td><td>${q.superseded.length}</td></tr>`}).join('')+'</table>';
|
| 16 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
document.querySelector('#demo').onclick=()=>{scenarioEl.value='mnemo-belief_revision-01';strategyEl.value='typed_lifecycle_lineage';render()};
|
| 18 |
scenarioEl.onchange=render; strategyEl.onchange=render;
|
| 19 |
document.querySelector('#file').onchange=e=>{const f=e.target.files[0];if(!f)return;const reader=new FileReader();reader.onload=()=>{try{const data=JSON.parse(reader.result);if(data.scenario_id){scenarios.push(data);scenarioEl.value=data.scenario_id;render()}}catch{alert('Invalid local scenario')}};reader.readAsText(f)};
|
|
|
|
| 14 |
document.querySelector('#output').innerHTML=`<p><b>${r.strategy}</b></p><p>Current answer: ${r.current||'none'}</p><p>Active records: ${r.records.filter(x=>x.status==='active').length} 路 Superseded: ${r.superseded.length}</p><p>Evidence families counted: ${r.evidence.join(', ')}</p>`;
|
| 15 |
document.querySelector('#comparison').innerHTML='<table><tr><th>Strategy</th><th>Current answer</th><th>Superseded</th></tr>'+MnemosyneCore.strategies.map(x=>{const q=MnemosyneCore.run(x,s);return `<tr><td>${x}</td><td>${q.current||'none'}</td><td>${q.superseded.length}</td></tr>`}).join('')+'</table>';
|
| 16 |
}
|
| 17 |
+
document.querySelector('#download').onclick=()=>{
|
| 18 |
+
const s=scenarios.find(x=>x.scenario_id===scenarioEl.value)||scenarios[0];
|
| 19 |
+
const result={benchmark_version:MNEMOSYNE_VALIDITY.revision,scenario_id:s.scenario_id,strategy:strategyEl.value,output:MnemosyneCore.run(strategyEl.value,s)};
|
| 20 |
+
const a=document.createElement('a');a.href=URL.createObjectURL(new Blob([JSON.stringify(result,null,2)],{type:'application/json'}));a.download=`mnemosyne-${s.scenario_id}-${strategyEl.value}.json`;a.click();URL.revokeObjectURL(a.href);
|
| 21 |
+
};
|
| 22 |
document.querySelector('#demo').onclick=()=>{scenarioEl.value='mnemo-belief_revision-01';strategyEl.value='typed_lifecycle_lineage';render()};
|
| 23 |
scenarioEl.onchange=render; strategyEl.onchange=render;
|
| 24 |
document.querySelector('#file').onchange=e=>{const f=e.target.files[0];if(!f)return;const reader=new FileReader();reader.onload=()=>{try{const data=JSON.parse(reader.result);if(data.scenario_id){scenarios.push(data);scenarioEl.value=data.scenario_id;render()}}catch{alert('Invalid local scenario')}};reader.readAsText(f)};
|
index.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<!doctype html>
|
| 2 |
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Mnemosyne Memory Lab</title><link rel="stylesheet" href="styles.css"></head>
|
| 3 |
<body><main><header><p class="kicker">SOLSTICE AGENT RELIABILITY LAB</p><h1>Mnemosyne Memory Lab</h1><p>Compare how memory architectures handle changing beliefs, stale procedures, duplicated evidence, privacy boundaries, and historical reconstruction.</p><p class="notice">40 deterministic synthetic scenarios 路 5 strategies 路 browser-local processing</p></header>
|
| 4 |
-
<section class="controls"><button id="demo">Run the changed-preference demo</button><label>Scenario <select id="scenario"></select></label><label>Strategy <select id="strategy"></select></label><input id="file" type="file" accept=".json,.jsonl"></section>
|
| 5 |
<section id="summary" class="panel"></section><section id="validity" class="panel"></section>
|
| 6 |
<section class="grid"><article class="panel"><h2>Observation timeline</h2><div id="timeline"></div></article><article class="panel"><h2>Strategy output</h2><div id="output"></div></article></section>
|
| 7 |
<section class="panel"><h2>Five-strategy comparison</h2><div id="comparison"></div></section><footer>All records are synthetic. This visualization does not claim real-world memory accuracy, complete erasure, or production privacy.</footer></main>
|
|
|
|
| 1 |
<!doctype html>
|
| 2 |
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Mnemosyne Memory Lab</title><link rel="stylesheet" href="styles.css"></head>
|
| 3 |
<body><main><header><p class="kicker">SOLSTICE AGENT RELIABILITY LAB</p><h1>Mnemosyne Memory Lab</h1><p>Compare how memory architectures handle changing beliefs, stale procedures, duplicated evidence, privacy boundaries, and historical reconstruction.</p><p class="notice">40 deterministic synthetic scenarios 路 5 strategies 路 browser-local processing</p></header>
|
| 4 |
+
<section class="controls"><button id="demo">Run the changed-preference demo</button><button id="download">Download result</button><label>Scenario <select id="scenario"></select></label><label>Strategy <select id="strategy"></select></label><input id="file" type="file" accept=".json,.jsonl"></section>
|
| 5 |
<section id="summary" class="panel"></section><section id="validity" class="panel"></section>
|
| 6 |
<section class="grid"><article class="panel"><h2>Observation timeline</h2><div id="timeline"></div></article><article class="panel"><h2>Strategy output</h2><div id="output"></div></article></section>
|
| 7 |
<section class="panel"><h2>Five-strategy comparison</h2><div id="comparison"></div></section><footer>All records are synthetic. This visualization does not claim real-world memory accuracy, complete erasure, or production privacy.</footer></main>
|