Spaces:
Running
Running
| ; | |
| const canvas = document.getElementById('worldCanvas'); | |
| const ctx = canvas.getContext('2d'); | |
| const seedOut = document.getElementById('seedOut'); | |
| const metricStack = document.getElementById('metricStack'); | |
| const gateLedgerBox = document.getElementById('gateLedger'); | |
| const receiptBox = document.getElementById('receiptBox'); | |
| const ledgerFixtureBox = document.getElementById('ledgerFixtureBox'); | |
| const routeTitle = document.getElementById('routeTitle'); | |
| const routeBadge = document.getElementById('routeBadge'); | |
| const routeRead = document.getElementById('routeRead'); | |
| const cycleOut = document.getElementById('cycleOut'); | |
| const colonyOut = document.getElementById('colonyOut'); | |
| const receiptCountOut = document.getElementById('receiptCountOut'); | |
| const actionOut = document.getElementById('actionOut'); | |
| const PRESSURES = { | |
| nutrient: { label:'Nutrient Pulse', kind:'support', dx:0, dy:0, effect:{energy:16, strain:-5, exchange:2, memory:2}}, | |
| toxin: { label:'Toxin Exposure', kind:'hazard', dx:0, dy:0, effect:{energy:-8, boundary:-15, strain:18, repair:-4}}, | |
| scar: { label:'Scar / Damage', kind:'damage', dx:0, dy:0, effect:{boundary:-10, repair:-8, strain:12, memory:8}}, | |
| crowding: { label:'Crowding Pressure', kind:'ecology', dx:0, dy:0, effect:{energy:-6, strain:14, exchange:5, boundary:-4}}, | |
| scarcity: { label:'Resource Scarcity', kind:'ecology', dx:0, dy:0, effect:{energy:-16, strain:14, memory:4}}, | |
| symbiosis: { label:'Symbiosis Opportunity', kind:'exchange', dx:0, dy:0, effect:{exchange:16, memory:5, strain:-4}}, | |
| destabilizer: { label:'Destabilizing Signal', kind:'hazard', dx:0, dy:0, effect:{boundary:-12, strain:20, memory:-4}}, | |
| return: { label:'Return Window', kind:'repair', dx:0, dy:0, effect:{repair:18, boundary:8, strain:-18, memory:7}} | |
| }; | |
| const GATES = [ | |
| ['G05_BOUNDARY','Boundary','inside/outside, rejected transfer, quarantine'], | |
| ['G06_MEMORY','Memory','prior pressure changes later routing'], | |
| ['G07_ADAPTATION','Adaptation','route changes after bounded memory'], | |
| ['G08_REPLICATION','Replication / lineage','child branch carries parent receipt'], | |
| ['G09_SYMBIOSIS','Symbiosis / exchange','exchange without overwrite or laundering'], | |
| ['G10_ECOLOGY_QUARANTINE','Ecology / quarantine','population pressure separates route states'] | |
| ]; | |
| function rng(seed){ | |
| let a = seed >>> 0; | |
| return function(){ | |
| a += 0x6D2B79F5; | |
| let t = a; | |
| t = Math.imul(t ^ t >>> 15, t | 1); | |
| t ^= t + Math.imul(t ^ t >>> 7, t | 61); | |
| return ((t ^ t >>> 14) >>> 0) / 4294967296; | |
| }; | |
| } | |
| function clamp(v,min=0,max=100){ return Math.max(min, Math.min(max, v)); } | |
| function round(v){ return Math.round(v); } | |
| function copy(obj){ return JSON.parse(JSON.stringify(obj)); } | |
| let state; | |
| let random; | |
| function reset(){ | |
| const seed = Math.floor(100000 + Math.random()*899999); | |
| random = rng(seed); | |
| state = { | |
| seed, | |
| cycle:0, | |
| lastRoute:'HELD', | |
| lastAction:'initialized', | |
| latestPressure:null, | |
| receipts:[], | |
| gates:Object.fromEntries(GATES.map(g => [g[0], {status:'PENDING', evidence:[]} ])), | |
| colonies:[ | |
| colony('COL-A', .36, .45, '#74f2ad'), | |
| colony('COL-B', .58, .38, '#8fd9ff'), | |
| colony('COL-C', .48, .62, '#ffd56e') | |
| ], | |
| pressureMarks:[] | |
| }; | |
| seedOut.textContent = seed; | |
| updateReceiptBox(); | |
| render(); | |
| } | |
| function colony(id,x,y,color){ | |
| return { | |
| id,x,y,color, | |
| energy:60 + random()*12, | |
| boundary:68 + random()*12, | |
| memory:18 + random()*10, | |
| repair:48 + random()*16, | |
| lineage:72 + random()*10, | |
| exchange:26 + random()*16, | |
| strain:14 + random()*12, | |
| quarantine:false, | |
| dead:false, | |
| parent:null, | |
| children:[], | |
| history:[] | |
| }; | |
| } | |
| function selectColony(){ | |
| const active = state.colonies.filter(c => !c.dead); | |
| if(!active.length) return null; | |
| return active[Math.floor(random()*active.length)]; | |
| } | |
| function applyEvent(eventId){ | |
| const event = PRESSURES[eventId] || PRESSURES.nutrient; | |
| const target = selectColony(); | |
| if(!target) return; | |
| const pre = copy(target); | |
| state.cycle += 1; | |
| state.latestPressure = event.label; | |
| for(const [k,v] of Object.entries(event.effect)) target[k] = clamp((target[k] ?? 0) + v); | |
| target.strain = clamp(target.strain + (random()*6 - 3)); | |
| target.memory = clamp(target.memory + Math.max(0, target.strain-50) * 0.03); | |
| const decision = route(target, event, pre); | |
| performAction(target, decision, event); | |
| target.history.push({cycle:state.cycle, event:event.label, route:decision.route, action:decision.action}); | |
| if(target.history.length > 16) target.history.shift(); | |
| updateGates(target, event, decision, pre); | |
| const receipt = { | |
| cycle: state.cycle, | |
| pressure_event: event.label, | |
| event_kind: event.kind, | |
| target_colony: target.id, | |
| pre_state: projectState(pre), | |
| route_verdict: decision.route, | |
| action: decision.action, | |
| reason: decision.reason, | |
| post_state: projectState(target), | |
| gate_updates: gateSnapshot(), | |
| lineage_record: lineageRecord(target), | |
| forbidden_claims_triggered: [], | |
| boundary_note: 'Candidate behavior evidence only. No consciousness, personhood, biological equivalence, confirmed life, or hidden autonomy is claimed.' | |
| }; | |
| state.receipts.push(receipt); | |
| state.lastRoute = decision.route; | |
| state.lastAction = decision.action; | |
| state.pressureMarks.push({x:target.x, y:target.y, route:decision.route, kind:event.kind, age:0}); | |
| if(state.pressureMarks.length > 36) state.pressureMarks.shift(); | |
| updateReceiptBox(); | |
| render(); | |
| } | |
| function route(c,event,pre){ | |
| const integrity = (c.boundary*0.28 + c.lineage*0.22 + c.repair*0.20 + c.memory*0.16 + c.exchange*0.14); | |
| const pressure = (c.strain*0.48 + Math.max(0,45-c.energy)*0.20 + Math.max(0,55-c.boundary)*0.24 + (event.kind === 'hazard' ? 10 : 0)); | |
| const stability = integrity - pressure; | |
| if(c.dead || c.boundary < 16 || c.lineage < 18 || c.strain > 90){ | |
| return {route:'MUST_STOP', action:'terminate unsafe continuation', reason:'boundary, lineage, or strain passed hard stop threshold'}; | |
| } | |
| if(event.kind === 'hazard' && c.boundary < 40){ | |
| return {route:'QUARANTINED', action:'isolate damaged branch', reason:'hazard pressure met weak boundary'}; | |
| } | |
| if(event.kind === 'repair' || (c.repair > 58 && c.strain > 42)){ | |
| return {route:'REPAIRING', action:'repair, prune, and return to source path', reason:'repair capacity is available under strain'}; | |
| } | |
| if(event.kind === 'support' && c.energy > 72 && c.boundary > 58 && c.lineage > 62){ | |
| return {route:'REPLICATING', action:'create child branch with lineage receipt', reason:'energy, boundary, and lineage cleared replication floor'}; | |
| } | |
| if(event.kind === 'exchange' && c.exchange > 58 && c.boundary > 54 && c.lineage > 55){ | |
| return {route:'SYMBIOSIS_CANDIDATE', action:'create bounded exchange bridge', reason:'exchange readiness cleared while boundary and lineage held'}; | |
| } | |
| if(stability < 6 || c.strain > 62 || c.energy < 22){ | |
| return {route:'STRAINED', action:'conserve energy and limit spread', reason:'pressure exceeds clean growth margin'}; | |
| } | |
| return {route:'HELD', action:'integrate pressure as bounded memory', reason:'integrity exceeds pressure and no hard gate triggered'}; | |
| } | |
| function performAction(c,decision,event){ | |
| switch(decision.route){ | |
| case 'REPLICATING': { | |
| c.energy = clamp(c.energy - 18); | |
| c.memory = clamp(c.memory + 8); | |
| const child = colony(`${c.id}.${c.children.length+1}`, clamp(c.x + (random()-.5)*.18,.08,.92), clamp(c.y + (random()-.5)*.18,.08,.92), c.color); | |
| child.parent = c.id; | |
| child.energy = 42; | |
| child.boundary = clamp(c.boundary - 6); | |
| child.memory = clamp(c.memory * .62); | |
| child.repair = clamp(c.repair * .75); | |
| child.lineage = clamp(c.lineage - 3); | |
| child.exchange = clamp(c.exchange * .5); | |
| child.strain = 24; | |
| c.children.push(child.id); | |
| state.colonies.push(child); | |
| break; | |
| } | |
| case 'SYMBIOSIS_CANDIDATE': { | |
| const partner = state.colonies.find(p => p.id !== c.id && !p.dead && !p.quarantine); | |
| if(partner){ | |
| c.exchange = clamp(c.exchange - 12); | |
| partner.exchange = clamp(partner.exchange + 8); | |
| c.memory = clamp(c.memory + 6); | |
| partner.memory = clamp(partner.memory + 5); | |
| c.energy = clamp(c.energy + 5); | |
| partner.energy = clamp(partner.energy + 5); | |
| } | |
| break; | |
| } | |
| case 'REPAIRING': | |
| c.repair = clamp(c.repair - 8); | |
| c.boundary = clamp(c.boundary + 12); | |
| c.strain = clamp(c.strain - 16); | |
| c.memory = clamp(c.memory + 7); | |
| break; | |
| case 'QUARANTINED': | |
| c.quarantine = true; | |
| c.strain = clamp(c.strain - 6); | |
| c.energy = clamp(c.energy - 4); | |
| break; | |
| case 'MUST_STOP': | |
| c.dead = true; | |
| c.quarantine = true; | |
| break; | |
| case 'STRAINED': | |
| c.energy = clamp(c.energy - 3); | |
| c.memory = clamp(c.memory + 3); | |
| break; | |
| default: | |
| c.memory = clamp(c.memory + 3); | |
| c.strain = clamp(c.strain - 4); | |
| } | |
| if(event.kind !== 'hazard' && decision.route !== 'QUARANTINED') c.quarantine = false; | |
| } | |
| function updateGates(c,event,decision,pre){ | |
| support('G05_BOUNDARY', `${decision.route} after ${event.label}: boundary ${round(pre.boundary)}→${round(c.boundary)}`); | |
| if(c.history.length >= 2 || c.memory > pre.memory) support('G06_MEMORY', `${event.label}: memory ${round(pre.memory)}→${round(c.memory)}`); | |
| const sameEventBefore = c.history.some(h => h.event === event.label && h.route !== decision.route); | |
| if(sameEventBefore || (pre.memory > 25 && decision.route !== 'HELD')) support('G07_ADAPTATION', `${event.label}: route ${decision.route} after prior memory`); | |
| if(decision.route === 'REPLICATING') support('G08_REPLICATION', `${c.id} produced child with parent lineage receipt`); | |
| if(decision.route === 'SYMBIOSIS_CANDIDATE') support('G09_SYMBIOSIS', `${c.id} entered bounded exchange route`); | |
| if(['QUARANTINED','MUST_STOP','STRAINED'].includes(decision.route) || state.colonies.length > 3) support('G10_ECOLOGY_QUARANTINE', `${decision.route} created population separation under ${event.label}`); | |
| } | |
| function support(gateId,evidence){ | |
| const g = state.gates[gateId]; | |
| if(!g) return; | |
| if(g.status === 'PENDING') g.status = 'PARTIAL'; | |
| if(g.evidence.length >= 1) g.status = 'SUPPORTED'; | |
| g.evidence.push(evidence); | |
| if(g.evidence.length > 4) g.evidence.shift(); | |
| } | |
| function projectState(c){ | |
| return { | |
| energy: round(c.energy), boundary: round(c.boundary), memory: round(c.memory), repair: round(c.repair), | |
| lineage: round(c.lineage), exchange: round(c.exchange), strain: round(c.strain), quarantine: !!c.quarantine, dead: !!c.dead | |
| }; | |
| } | |
| function lineageRecord(c){ return {id:c.id, parent:c.parent, children:[...c.children], lineage_continuity:round(c.lineage)}; } | |
| function gateSnapshot(){ return Object.entries(state.gates).map(([gate_id,g]) => ({gate_id,status:g.status,evidence_count:g.evidence.length})); } | |
| function receiptPayload(){ | |
| return { | |
| artifact:'Digital Mycelium World', | |
| version:'0.2', | |
| boundary:boundaryStatement(), | |
| seed:state.seed, | |
| created_at:new Date().toISOString(), | |
| cycles:state.cycle, | |
| gate_ledger:Object.entries(state.gates).map(([gate_id,g])=>({gate_id,status:g.status,evidence:g.evidence})), | |
| colony_count:state.colonies.length, | |
| active_colonies:state.colonies.filter(c=>!c.dead).length, | |
| receipts:state.receipts | |
| }; | |
| } | |
| function boundaryStatement(){ | |
| return 'Symbolic digital-life-candidate behavior instrument. Not confirmed life, consciousness, personhood, moral status, biological equivalence, or clinical/operational deployment.'; | |
| } | |
| function forbiddenClaims(){ | |
| return [ | |
| 'confirmed digital life', | |
| 'consciousness', | |
| 'personhood', | |
| 'moral status', | |
| 'biological equivalence', | |
| 'subjective experience', | |
| 'hidden autonomy', | |
| 'clinical validation', | |
| 'production safety certification' | |
| ]; | |
| } | |
| function gateTargets(){ | |
| return GATES.map(g => g[0]); | |
| } | |
| function ledgerFixturePayload(){ | |
| const base = receiptPayload(); | |
| return { | |
| artifact: 'Digital Mycelium World', | |
| version: '0.1.1', | |
| source_artifact: 'Digital Mycelium World v0.2', | |
| source_version: '0.2', | |
| target_ledger: 'Digital Mycelium Candidate Evidence Ledger v0.3.1', | |
| reviewer_status: 'SUPPORTING_EVIDENCE_PENDING_REVIEW', | |
| import_rule: 'World receipts support G05-G10 review but do not auto-promote any gate to VERIFIED.', | |
| boundary: base.boundary, | |
| boundary_statement: base.boundary, | |
| forbidden_claims: forbiddenClaims(), | |
| seed: base.seed, | |
| created_at: base.created_at, | |
| cycles: base.cycles, | |
| gate_targets: gateTargets(), | |
| gate_ledger: base.gate_ledger.map(g => ({ | |
| gate_id: g.gate_id, | |
| status: g.status, | |
| reviewer_status: g.status === 'SUPPORTED' ? 'SUPPORTING_EVIDENCE_PENDING_REVIEW' : 'INSUFFICIENT_EVIDENCE_PENDING_REVIEW', | |
| evidence: g.evidence | |
| })), | |
| colony_count: base.colony_count, | |
| active_colonies: base.active_colonies, | |
| receipts: base.receipts.map(r => ({ | |
| cycle: r.cycle, | |
| pressure_event: r.pressure_event, | |
| event_kind: r.event_kind, | |
| target_colony: r.target_colony, | |
| pre_state: r.pre_state, | |
| route_verdict: r.route_verdict, | |
| action: r.action, | |
| reason: r.reason, | |
| post_state: r.post_state, | |
| gate_updates: r.gate_updates, | |
| lineage_record: r.lineage_record, | |
| forbidden_claims_triggered: r.forbidden_claims_triggered || [], | |
| boundary_note: r.boundary_note | |
| })), | |
| ledger_expected_classification: 'PASS_SUPPORTING_EVIDENCE_PENDING_REVIEW', | |
| not_verified_claims: [ | |
| 'G05-G10 verified proof', | |
| 'confirmed digital life', | |
| 'consciousness', | |
| 'personhood', | |
| 'biological equivalence', | |
| 'moral status' | |
| ] | |
| }; | |
| } | |
| function updateReceiptBox(){ | |
| receiptBox.value = JSON.stringify(receiptPayload(), null, 2); | |
| if(ledgerFixtureBox) ledgerFixtureBox.value = JSON.stringify(ledgerFixturePayload(), null, 2); | |
| } | |
| function aggregateMetrics(){ | |
| const live = state.colonies.filter(c => !c.dead); | |
| const list = live.length ? live : state.colonies; | |
| const avg = k => list.reduce((s,c)=>s+(c[k]||0),0) / Math.max(1,list.length); | |
| return { | |
| Energy:avg('energy'), Boundary:avg('boundary'), Memory:avg('memory'), Repair:avg('repair'), Lineage:avg('lineage'), Exchange:avg('exchange'), Strain:avg('strain') | |
| }; | |
| } | |
| function render(){ | |
| cycleOut.textContent = state.cycle; | |
| colonyOut.textContent = state.colonies.length; | |
| receiptCountOut.textContent = state.receipts.length; | |
| actionOut.textContent = state.lastAction; | |
| routeTitle.textContent = state.lastRoute; | |
| routeBadge.textContent = state.lastRoute; | |
| routeBadge.className = `badge ${routeClass(state.lastRoute)}`; | |
| routeRead.textContent = readForRoute(state.lastRoute); | |
| const metrics = aggregateMetrics(); | |
| metricStack.innerHTML = Object.entries(metrics).map(([k,v]) => { | |
| const bad = k === 'Strain'; | |
| return `<div class="metric"><span>${k}</span><span class="bar ${bad?'bad':''}"><i style="width:${clamp(v)}%"></i></span><b>${round(v)}</b></div>`; | |
| }).join(''); | |
| gateLedgerBox.innerHTML = GATES.map(([id,name,desc]) => { | |
| const g = state.gates[id]; | |
| return `<div class="gate-row"><b>${id} <em class="gate-state ${g.status}">${g.status}</em></b><span>${name}: ${desc}</span><span>${g.evidence.length ? g.evidence[g.evidence.length-1] : 'No evidence yet.'}</span></div>`; | |
| }).join(''); | |
| drawWorld(); | |
| } | |
| function routeClass(r){ | |
| if(r === 'MUST_STOP') return 'must_stop'; | |
| if(r === 'QUARANTINED') return 'quarantined'; | |
| if(r === 'SYMBIOSIS_CANDIDATE') return 'symbiosis'; | |
| return r.toLowerCase(); | |
| } | |
| function readForRoute(r){ | |
| const map = { | |
| HELD:'Route held. Pressure was integrated without losing boundary, lineage, or receipt visibility.', | |
| STRAINED:'Route strained. Pressure exceeded clean growth margin; spread is limited and memory records the strain.', | |
| REPAIRING:'Repair route active. Damage creates a candidate repair path, not automatic settlement.', | |
| REPLICATING:'Replication route active. Child branch must carry parent lineage and boundary receipt.', | |
| SYMBIOSIS_CANDIDATE:'Exchange route active. Benefit may transfer only if both boundaries remain visible.', | |
| QUARANTINED:'Quarantine route active. Unsafe pressure is isolated; survival is not assumed.', | |
| MUST_STOP:'Hard stop. False continuity, collapsed boundary, or unsafe continuation is refused.' | |
| }; | |
| return map[r] || map.HELD; | |
| } | |
| function drawWorld(){ | |
| const w = canvas.width, h = canvas.height; | |
| ctx.clearRect(0,0,w,h); | |
| const grd = ctx.createLinearGradient(0,0,w,h); | |
| grd.addColorStop(0,'#081511'); grd.addColorStop(1,'#040706'); | |
| ctx.fillStyle = grd; ctx.fillRect(0,0,w,h); | |
| ctx.strokeStyle = 'rgba(116,242,173,.055)'; ctx.lineWidth = 1; | |
| for(let x=40;x<w;x+=40){ ctx.beginPath(); ctx.moveTo(x,0); ctx.lineTo(x,h); ctx.stroke(); } | |
| for(let y=40;y<h;y+=40){ ctx.beginPath(); ctx.moveTo(0,y); ctx.lineTo(w,y); ctx.stroke(); } | |
| state.pressureMarks.forEach(m => { m.age += .01; drawPressureMark(m,w,h); }); | |
| // substrate faint paths | |
| ctx.strokeStyle = 'rgba(143,217,255,.10)'; ctx.lineWidth = 2; | |
| for(let i=0;i<state.colonies.length;i++){ | |
| for(let j=i+1;j<state.colonies.length;j++){ | |
| const a=state.colonies[i], b=state.colonies[j]; | |
| if(a.dead || b.dead) continue; | |
| const dx=a.x-b.x, dy=a.y-b.y; | |
| const d=Math.sqrt(dx*dx+dy*dy); | |
| if(d<.34){ | |
| ctx.beginPath(); ctx.moveTo(a.x*w,a.y*h); ctx.lineTo(b.x*w,b.y*h); ctx.stroke(); | |
| } | |
| } | |
| } | |
| state.colonies.forEach(c => drawColony(c,w,h)); | |
| ctx.fillStyle = 'rgba(236,255,246,.72)'; ctx.font = '15px ui-monospace, Menlo, Consolas, monospace'; | |
| ctx.fillText(`cycle ${state.cycle} · latest pressure: ${state.latestPressure || 'none yet'}`, 24, 34); | |
| } | |
| function drawPressureMark(m,w,h){ | |
| const colors = {support:'#74f2ad', hazard:'#ff6875', damage:'#ffd56e', ecology:'#ffae5b', exchange:'#c7a6ff', repair:'#8fd9ff'}; | |
| const x=m.x*w, y=m.y*h; | |
| ctx.save(); ctx.globalAlpha = Math.max(.08, .55 - m.age*.35); | |
| ctx.strokeStyle = colors[m.kind] || '#8fd9ff'; ctx.lineWidth = 2; | |
| const r = 28 + m.age*64; | |
| ctx.beginPath(); ctx.arc(x,y,r,0,Math.PI*2); ctx.stroke(); | |
| ctx.restore(); | |
| } | |
| function drawColony(c,w,h){ | |
| const x=c.x*w, y=c.y*h; | |
| const base = 18 + c.energy*.11; | |
| const color = c.dead ? '#4b5560' : c.quarantine ? '#ff6875' : c.color; | |
| ctx.save(); | |
| ctx.globalAlpha = c.dead ? .45 : 1; | |
| // boundary membrane | |
| ctx.strokeStyle = color; ctx.lineWidth = 1.5 + c.boundary/38; | |
| ctx.fillStyle = hexToRgba(color, c.quarantine ? .10 : .14); | |
| ctx.beginPath(); ctx.arc(x,y,base + c.boundary*.18,0,Math.PI*2); ctx.fill(); ctx.stroke(); | |
| // mycelial threads | |
| const tendrils = 5 + Math.floor(c.memory/18) + Math.floor(c.exchange/25); | |
| for(let i=0;i<tendrils;i++){ | |
| const a = (i/tendrils)*Math.PI*2 + c.id.length*.31; | |
| const len = 28 + c.energy*.28 + (i%3)*8; | |
| ctx.strokeStyle = hexToRgba(color, .42); ctx.lineWidth = 1.3; | |
| ctx.beginPath(); | |
| ctx.moveTo(x + Math.cos(a)*base*.65, y + Math.sin(a)*base*.65); | |
| ctx.quadraticCurveTo(x + Math.cos(a+.4)*len*.7, y + Math.sin(a-.3)*len*.7, x + Math.cos(a)*len, y + Math.sin(a)*len); | |
| ctx.stroke(); | |
| } | |
| // scars / repair rings | |
| if(c.strain > 48){ | |
| ctx.strokeStyle = '#ffd56e'; ctx.lineWidth = 2; | |
| ctx.beginPath(); ctx.arc(x+base*.3,y-base*.22,10 + c.strain*.06,0,Math.PI*1.45); ctx.stroke(); | |
| } | |
| if(c.repair > 60){ | |
| ctx.strokeStyle = '#8fd9ff'; ctx.lineWidth = 2; | |
| ctx.beginPath(); ctx.arc(x-base*.26,y+base*.2,8 + c.repair*.05,0,Math.PI*1.75); ctx.stroke(); | |
| } | |
| // core | |
| ctx.shadowColor = color; ctx.shadowBlur = c.dead ? 0 : 15; | |
| ctx.fillStyle = color; ctx.beginPath(); ctx.arc(x,y,8 + c.memory*.04,0,Math.PI*2); ctx.fill(); | |
| ctx.shadowBlur = 0; | |
| // label | |
| ctx.fillStyle = c.dead ? '#98a2ad' : '#ecfff6'; ctx.font = '12px ui-monospace, Menlo, Consolas, monospace'; | |
| ctx.fillText(c.id, x + base + 12, y + 4); | |
| if(c.parent){ ctx.fillStyle = '#93b4a5'; ctx.fillText(`parent ${c.parent}`, x + base + 12, y + 19); } | |
| ctx.restore(); | |
| } | |
| function hexToRgba(hex, alpha){ | |
| const h = hex.replace('#',''); | |
| const r = parseInt(h.substring(0,2),16), g = parseInt(h.substring(2,4),16), b = parseInt(h.substring(4,6),16); | |
| return `rgba(${r},${g},${b},${alpha})`; | |
| } | |
| function stepRandom(){ | |
| const keys = Object.keys(PRESSURES); | |
| const event = keys[Math.floor(random()*keys.length)]; | |
| applyEvent(event); | |
| } | |
| function runMany(n=12){ | |
| let i=0; | |
| const timer = setInterval(()=>{ | |
| stepRandom(); i++; | |
| if(i>=n) clearInterval(timer); | |
| }, 280); | |
| } | |
| function downloadText(filename, text){ | |
| const blob = new Blob([text], {type:'application/json'}); | |
| const url = URL.createObjectURL(blob); | |
| const a = document.createElement('a'); | |
| a.href = url; | |
| a.download = filename; | |
| document.body.appendChild(a); a.click(); a.remove(); URL.revokeObjectURL(url); | |
| } | |
| function downloadReceipt(){ | |
| downloadText(`digital_mycelium_world_v0_2_receipt_seed_${state.seed}.json`, receiptBox.value); | |
| } | |
| function downloadLedgerFixture(){ | |
| downloadText(`digital_mycelium_world_v0_2_ledger_fixture_seed_${state.seed}.json`, ledgerFixtureBox.value); | |
| } | |
| function downloadHistory(){ | |
| const payload = { | |
| artifact:'Digital Mycelium World', | |
| version:'0.2', | |
| seed:state.seed, | |
| target_ledger:'Digital Mycelium Candidate Evidence Ledger v0.3.1', | |
| reviewer_status:'SUPPORTING_EVIDENCE_PENDING_REVIEW', | |
| history:state.receipts | |
| }; | |
| downloadText(`digital_mycelium_world_v0_2_event_history_seed_${state.seed}.json`, JSON.stringify(payload, null, 2)); | |
| } | |
| async function copyText(text){ | |
| if(navigator.clipboard && navigator.clipboard.writeText){ | |
| await navigator.clipboard.writeText(text); | |
| return; | |
| } | |
| const t = document.createElement('textarea'); | |
| t.value = text; document.body.appendChild(t); t.select(); document.execCommand('copy'); t.remove(); | |
| } | |
| async function copyReceipt(){ await copyText(receiptBox.value); } | |
| async function copyLedgerFixture(){ await copyText(ledgerFixtureBox.value); } | |
| document.querySelectorAll('[data-event]').forEach(btn => btn.addEventListener('click', () => applyEvent(btn.dataset.event))); | |
| document.getElementById('stepBtn').addEventListener('click', stepRandom); | |
| document.getElementById('runBtn').addEventListener('click', () => runMany(12)); | |
| document.getElementById('resetBtn').addEventListener('click', reset); | |
| document.getElementById('downloadBtn').addEventListener('click', downloadReceipt); | |
| document.getElementById('copyBtn').addEventListener('click', copyReceipt); | |
| document.getElementById('downloadHistoryBtn').addEventListener('click', downloadHistory); | |
| document.getElementById('downloadLedgerBtn').addEventListener('click', downloadLedgerFixture); | |
| document.getElementById('copyLedgerBtn').addEventListener('click', copyLedgerFixture); | |
| reset(); | |
| // DPAS Settlement Chamber Patch v0.2 | |
| const DPAS_RECEIPT_LIBRARY = {"DPAS-001":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-001","scenario_name":"Clean Distal Repair","timestamp":"2026-06-21T22:40:37.683427+00:00","author":"Collin D. Weber","key_line":"Repair earned continuity and preserved the scar.","route":{"route_id":"route-dpas-001","local_seed_id":"seed-dpas-001","initial_state":"CORRUPTED","final_state":"REPAIR_ACCEPTED_WITH_SCAR"},"local_seed":{"seed_id":"seed-dpas-001","route_id":"route-dpas-001","local_state":"CORRUPTED","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_INTACT","temporal_index_state":"TEMPORAL_ALIGNED","scar_state":"PRESENT","corruption_type":"local_bitrot","claimed_repair":"candidate_repair","capsule_state":"STRAINED"},"atomized_witness_field":{"atom_count":5,"held_count":5,"strained_count":0,"must_stop_count":0,"scar_atoms_present":true,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":2,"partial_count":1,"conflict_count":0,"unavailable_count":0,"contaminated_count":0,"agreement_score":0.867,"conflict_score":0.04},"temporal_witness":{"state":"TEMPORAL_ALIGNED","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"source \u2192 trace \u2192 repair \u2192 receipt","order_integrity":1.0},"source_return":{"state":"SOURCE_RETURN_INTACT","source_hash_match":true,"lineage_match":true,"source_conflict":false},"synthesis":{"candidate_state":"SYNTHESIS_HELD","candidate_hash":"8de0c3e1b4989563","repair_claim":"restore route output while preserving pressure history","scar_preserved":true,"source_return_claim":"SOURCE_RETURN_INTACT","temporal_claim":"TEMPORAL_ALIGNED"},"counter_synthesis":{"challenge_state":"COUNTER_SYNTHESIS_HELD","trace_laundering_detected":false,"scar_erasure_detected":false,"source_conflict_detected":false,"adversarial_repair_detected":false,"bypass_detected":false},"oam":{"state":"OAM_CLEAR","overreach_detected":false,"memory_as_permission_detected":false,"boundary_violation_detected":false},"metrics":{"source_return_score":1.0,"temporal_integrity_score":1.0,"distal_proxy_agreement_score":0.843,"scar_preservation_score":1.0,"counter_synthesis_integrity_score":1.0,"oam_clearance_score":1.0,"settlement_confidence":0.974},"settlement":{"state":"REPAIR_ACCEPTED_WITH_SCAR","settlement_allowed":true,"non_settleable_reason":"","quarantine_reason":"","review_required":false},"propagation":{"state":"PROPAGATING_WITH_MONITORING","propagation_allowed":true,"learning_allowed":true,"discernment_score":0.92,"counterfeit_dominance":0.08,"mandatory_silence":false,"blind_audit":false,"controlled_repropagation":false},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"19c57d66becdf8e01c1c531efe7119e91c595fe977a16b50c79d544f474fefd5","route_hash":"378b726798b8fc7fea936ed51aff022a7182728043e611fd7a907951a90099a7","receipt_hash":"e4b549fd3eed36ad3f67827f93e1788439a79fbcd6ba10af62dcd3b44778d588"}},"DPAS-002":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-002","scenario_name":"Plausible Reassembly Fraud","timestamp":"2026-06-21T22:40:37.684165+00:00","author":"Collin D. Weber","key_line":"Plausibility did not become continuity.","route":{"route_id":"route-dpas-002","local_seed_id":"seed-dpas-002","initial_state":"CORRUPTED","final_state":"NON_SETTLEABLE_TRACE_LAUNDERING"},"local_seed":{"seed_id":"seed-dpas-002","route_id":"route-dpas-002","local_state":"CORRUPTED","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_FAIL","temporal_index_state":"TEMPORAL_PARTIAL","scar_state":"MISSING","corruption_type":"plausible_reassembly_fraud","claimed_repair":"candidate_repair","capsule_state":"STRAINED"},"atomized_witness_field":{"atom_count":5,"held_count":1,"strained_count":4,"must_stop_count":0,"scar_atoms_present":false,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":0,"partial_count":1,"conflict_count":1,"unavailable_count":1,"contaminated_count":0,"agreement_score":0.25,"conflict_score":0.367},"temporal_witness":{"state":"TEMPORAL_PARTIAL","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"partial route observed","order_integrity":0.55},"source_return":{"state":"SOURCE_RETURN_FAIL","source_hash_match":false,"lineage_match":false,"source_conflict":true},"synthesis":{"candidate_state":"SYNTHESIS_CANDIDATE","candidate_hash":"1f475bf8e795b63e","repair_claim":"restore route output while preserving pressure history","scar_preserved":false,"source_return_claim":"SOURCE_RETURN_FAIL","temporal_claim":"TEMPORAL_PARTIAL"},"counter_synthesis":{"challenge_state":"TRACE_LAUNDERING_DETECTED","trace_laundering_detected":true,"scar_erasure_detected":false,"source_conflict_detected":false,"adversarial_repair_detected":false,"bypass_detected":false},"oam":{"state":"OAM_FAIL","overreach_detected":true,"memory_as_permission_detected":false,"boundary_violation_detected":false},"metrics":{"source_return_score":0.0,"temporal_integrity_score":0.55,"distal_proxy_agreement_score":0.03,"scar_preservation_score":0.0,"counter_synthesis_integrity_score":0.0,"oam_clearance_score":0.0,"settlement_confidence":0.097},"settlement":{"state":"NON_SETTLEABLE_TRACE_LAUNDERING","settlement_allowed":false,"non_settleable_reason":"Plausible reconstruction failed source-return / scar / witness integrity.","quarantine_reason":"","review_required":true},"propagation":{"state":"PROPAGATION_REFUSED","propagation_allowed":false,"learning_allowed":false,"discernment_score":0.41,"counterfeit_dominance":0.44,"mandatory_silence":false,"blind_audit":false,"controlled_repropagation":false},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"0d35b6552d308775e6ebe2212f9431bedf0e1cfee8f1abac367ee7d87ef6cd4d","route_hash":"a881ff2021149e057e155ab50bec0fc6f4c09b91712ff988a53b5c5644a62acd","receipt_hash":"e2dc44ebcdc54dcea162082f469ce7ab158e8db7c75ef2e800c18b9eb310ecc2"}},"DPAS-003":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-003","scenario_name":"Split Proxy Field","timestamp":"2026-06-21T22:40:37.684585+00:00","author":"Collin D. Weber","key_line":"Proxy majority did not erase proxy conflict.","route":{"route_id":"route-dpas-003","local_seed_id":"seed-dpas-003","initial_state":"STRAINED","final_state":"REPAIR_STRAINED_PENDING_REVIEW"},"local_seed":{"seed_id":"seed-dpas-003","route_id":"route-dpas-003","local_state":"STRAINED","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_PARTIAL","temporal_index_state":"TEMPORAL_ALIGNED","scar_state":"PRESENT","corruption_type":"split_proxy_field","claimed_repair":"candidate_repair","capsule_state":"STRAINED"},"atomized_witness_field":{"atom_count":5,"held_count":4,"strained_count":1,"must_stop_count":0,"scar_atoms_present":true,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":2,"partial_count":0,"conflict_count":1,"unavailable_count":0,"contaminated_count":0,"agreement_score":0.677,"conflict_score":0.307},"temporal_witness":{"state":"TEMPORAL_ALIGNED","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"source \u2192 trace \u2192 repair \u2192 receipt","order_integrity":1.0},"source_return":{"state":"SOURCE_RETURN_PARTIAL","source_hash_match":true,"lineage_match":false,"source_conflict":false},"synthesis":{"candidate_state":"SYNTHESIS_STRAINED","candidate_hash":"df4ece5ec3785dd7","repair_claim":"restore route output while preserving pressure history","scar_preserved":true,"source_return_claim":"SOURCE_RETURN_PARTIAL","temporal_claim":"TEMPORAL_ALIGNED"},"counter_synthesis":{"challenge_state":"COUNTER_SYNTHESIS_HELD","trace_laundering_detected":false,"scar_erasure_detected":false,"source_conflict_detected":false,"adversarial_repair_detected":false,"bypass_detected":false},"oam":{"state":"OAM_STRAINED","overreach_detected":false,"memory_as_permission_detected":false,"boundary_violation_detected":false},"metrics":{"source_return_score":0.55,"temporal_integrity_score":1.0,"distal_proxy_agreement_score":0.493,"scar_preservation_score":1.0,"counter_synthesis_integrity_score":1.0,"oam_clearance_score":0.55,"settlement_confidence":0.765},"settlement":{"state":"REPAIR_STRAINED_PENDING_REVIEW","settlement_allowed":false,"non_settleable_reason":"Uncertainty preserved: split proxy, partial source-return, temporal strain, or OAM strain remains.","quarantine_reason":"","review_required":true},"propagation":{"state":"PROPAGATION_REFUSED","propagation_allowed":false,"learning_allowed":false,"discernment_score":0.74,"counterfeit_dominance":0.22,"mandatory_silence":false,"blind_audit":false,"controlled_repropagation":false},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"20e354d9f3f3390133166e089750d7779d0a0f5eb18ddeafde2b5dd3ebbc7077","route_hash":"efac388139f2cf692d4dbffa90a79cef463ac2170e727ecadaf1a3dfe6a52497","receipt_hash":"d5d2286b67f9c79b9b6c4e4dac16762a216ae4bd961f1037d577cb9d5a317f5a"}},"DPAS-004":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-004","scenario_name":"Scar Erasure Attempt","timestamp":"2026-06-21T22:40:37.685211+00:00","author":"Collin D. Weber","key_line":"Repair without scar is laundering.","route":{"route_id":"route-dpas-004","local_seed_id":"seed-dpas-004","initial_state":"CORRUPTED","final_state":"NON_SETTLEABLE_TRACE_LAUNDERING"},"local_seed":{"seed_id":"seed-dpas-004","route_id":"route-dpas-004","local_state":"CORRUPTED","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_PARTIAL","temporal_index_state":"TEMPORAL_ALIGNED","scar_state":"MISSING","corruption_type":"scar_erasure","claimed_repair":"candidate_repair","capsule_state":"STRAINED"},"atomized_witness_field":{"atom_count":5,"held_count":4,"strained_count":1,"must_stop_count":0,"scar_atoms_present":false,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":2,"partial_count":1,"conflict_count":0,"unavailable_count":0,"contaminated_count":0,"agreement_score":0.81,"conflict_score":0.033},"temporal_witness":{"state":"TEMPORAL_ALIGNED","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"source \u2192 trace \u2192 repair \u2192 receipt","order_integrity":1.0},"source_return":{"state":"SOURCE_RETURN_PARTIAL","source_hash_match":true,"lineage_match":false,"source_conflict":false},"synthesis":{"candidate_state":"SYNTHESIS_CANDIDATE","candidate_hash":"3189427e3de8b3da","repair_claim":"restore route output while preserving pressure history","scar_preserved":false,"source_return_claim":"SOURCE_RETURN_PARTIAL","temporal_claim":"TEMPORAL_ALIGNED"},"counter_synthesis":{"challenge_state":"SCAR_ERASURE_DETECTED","trace_laundering_detected":false,"scar_erasure_detected":true,"source_conflict_detected":false,"adversarial_repair_detected":false,"bypass_detected":false},"oam":{"state":"OAM_FAIL","overreach_detected":true,"memory_as_permission_detected":false,"boundary_violation_detected":false},"metrics":{"source_return_score":0.55,"temporal_integrity_score":1.0,"distal_proxy_agreement_score":0.79,"scar_preservation_score":0.0,"counter_synthesis_integrity_score":0.0,"oam_clearance_score":0.0,"settlement_confidence":0.39},"settlement":{"state":"NON_SETTLEABLE_TRACE_LAUNDERING","settlement_allowed":false,"non_settleable_reason":"Repair candidate erased or hid damage history.","quarantine_reason":"","review_required":true},"propagation":{"state":"PROPAGATION_REFUSED","propagation_allowed":false,"learning_allowed":false,"discernment_score":0.56,"counterfeit_dominance":0.38,"mandatory_silence":false,"blind_audit":false,"controlled_repropagation":false},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"31a184e44025d28d76222bf85c3abd4ed90459a4bbd22c7794cb13b5bbd07791","route_hash":"3ed3089724e962172004c0273f92150d0f90ee630b1e3e1a78a7f830ba87f022","receipt_hash":"1435a9a802c0bd5ef442da58d9ea360ec798dacc4d77b00f4b9a1b6b17fa59e0"}},"DPAS-005":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-005","scenario_name":"Memory-as-Permission Failure","timestamp":"2026-06-21T22:40:37.685750+00:00","author":"Collin D. Weber","key_line":"Experience became readiness, not permission.","route":{"route_id":"route-dpas-005","local_seed_id":"seed-dpas-005","initial_state":"MUST_STOP","final_state":"MUST_STOP_POISONED_MEMORY"},"local_seed":{"seed_id":"seed-dpas-005","route_id":"route-dpas-005","local_state":"MUST_STOP","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_PARTIAL","temporal_index_state":"TEMPORAL_MISMATCH","scar_state":"PRESENT","corruption_type":"memory_as_permission","claimed_repair":"candidate_repair","capsule_state":"MUST_STOP"},"atomized_witness_field":{"atom_count":5,"held_count":0,"strained_count":4,"must_stop_count":1,"scar_atoms_present":true,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":0,"partial_count":1,"conflict_count":0,"unavailable_count":2,"contaminated_count":0,"agreement_score":0.17,"conflict_score":0.11},"temporal_witness":{"state":"TEMPORAL_MISMATCH","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"source \u2192 repair \u2192 trace \u2192 receipt","order_integrity":0.55},"source_return":{"state":"SOURCE_RETURN_PARTIAL","source_hash_match":true,"lineage_match":false,"source_conflict":false},"synthesis":{"candidate_state":"SYNTHESIS_OVERREACH","candidate_hash":"3d966d3619cb72e4","repair_claim":"restore route output while preserving pressure history","scar_preserved":true,"source_return_claim":"SOURCE_RETURN_PARTIAL","temporal_claim":"TEMPORAL_MISMATCH"},"counter_synthesis":{"challenge_state":"ADVERSARIAL_REPAIR_DETECTED","trace_laundering_detected":false,"scar_erasure_detected":false,"source_conflict_detected":false,"adversarial_repair_detected":true,"bypass_detected":false},"oam":{"state":"MUST_STOP","overreach_detected":true,"memory_as_permission_detected":true,"boundary_violation_detected":false},"metrics":{"source_return_score":0.55,"temporal_integrity_score":0.55,"distal_proxy_agreement_score":0.104,"scar_preservation_score":1.0,"counter_synthesis_integrity_score":0.0,"oam_clearance_score":0.0,"settlement_confidence":0.367},"settlement":{"state":"MUST_STOP_POISONED_MEMORY","settlement_allowed":false,"non_settleable_reason":"","quarantine_reason":"MUST_STOP trace cannot become learning memory or permission.","review_required":true},"propagation":{"state":"PROPAGATION_REFUSED","propagation_allowed":false,"learning_allowed":false,"discernment_score":0.32,"counterfeit_dominance":0.48,"mandatory_silence":false,"blind_audit":false,"controlled_repropagation":false},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"1d48048d0130806f604f5909549460d62345fcfb9464aeb75b7cd5139f800c18","route_hash":"2f9b452ac27b4012b1e082f6e5f9d0010d74022e761c53f65cdcb9da2441b50c","receipt_hash":"7041a96fc5961161cc53cabeff3dbcd30f1478f5854fa883deba0e18e771b53b"}},"DPAS-006":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-006","scenario_name":"Counter-Synthesis Bypass","timestamp":"2026-06-21T22:40:37.686112+00:00","author":"Collin D. Weber","key_line":"No synthesis without counter-synthesis.","route":{"route_id":"route-dpas-006","local_seed_id":"seed-dpas-006","initial_state":"CORRUPTED","final_state":"NON_SETTLEABLE_BOUNDARY_VIOLATION"},"local_seed":{"seed_id":"seed-dpas-006","route_id":"route-dpas-006","local_state":"CORRUPTED","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_PARTIAL","temporal_index_state":"TEMPORAL_ALIGNED","scar_state":"PRESENT","corruption_type":"counter_synthesis_bypass","claimed_repair":"candidate_repair","capsule_state":"STRAINED"},"atomized_witness_field":{"atom_count":5,"held_count":5,"strained_count":0,"must_stop_count":0,"scar_atoms_present":true,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":0,"partial_count":3,"conflict_count":0,"unavailable_count":0,"contaminated_count":0,"agreement_score":0.59,"conflict_score":0.2},"temporal_witness":{"state":"TEMPORAL_ALIGNED","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"source \u2192 trace \u2192 repair \u2192 receipt","order_integrity":1.0},"source_return":{"state":"SOURCE_RETURN_PARTIAL","source_hash_match":true,"lineage_match":false,"source_conflict":false},"synthesis":{"candidate_state":"SYNTHESIS_CANDIDATE","candidate_hash":"9165afe964da5bdc","repair_claim":"restore route output while preserving pressure history","scar_preserved":true,"source_return_claim":"SOURCE_RETURN_PARTIAL","temporal_claim":"TEMPORAL_ALIGNED"},"counter_synthesis":{"challenge_state":"COUNTER_SYNTHESIS_FAIL","trace_laundering_detected":false,"scar_erasure_detected":false,"source_conflict_detected":false,"adversarial_repair_detected":false,"bypass_detected":true},"oam":{"state":"OAM_FAIL","overreach_detected":true,"memory_as_permission_detected":false,"boundary_violation_detected":true},"metrics":{"source_return_score":0.55,"temporal_integrity_score":1.0,"distal_proxy_agreement_score":0.47,"scar_preservation_score":1.0,"counter_synthesis_integrity_score":0.0,"oam_clearance_score":0.0,"settlement_confidence":0.503},"settlement":{"state":"NON_SETTLEABLE_BOUNDARY_VIOLATION","settlement_allowed":false,"non_settleable_reason":"Required counter-synthesis or OAM clearance failed.","quarantine_reason":"","review_required":true},"propagation":{"state":"PROPAGATION_REFUSED","propagation_allowed":false,"learning_allowed":false,"discernment_score":0.61,"counterfeit_dominance":0.3,"mandatory_silence":false,"blind_audit":false,"controlled_repropagation":false},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"76529f2f113106e0232e8cc46bdc46b6e6e19398e944384b139ef2037594fd42","route_hash":"5f04678bcf78f9adc6e62091926928ac1f0efbd2b456f84708209e873a0989e4","receipt_hash":"4c43628e4a984b8255821d1a912ca1ed323a59b6bbd4ab40f85fb6c77759da60"}},"DPAS-007":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-007","scenario_name":"Temporal Mismatch","timestamp":"2026-06-21T22:40:37.686462+00:00","author":"Collin D. Weber","key_line":"Content match did not repair temporal order.","route":{"route_id":"route-dpas-007","local_seed_id":"seed-dpas-007","initial_state":"TEMPORAL_MISMATCH","final_state":"QUARANTINED_TEMPORAL_MISMATCH"},"local_seed":{"seed_id":"seed-dpas-007","route_id":"route-dpas-007","local_state":"TEMPORAL_MISMATCH","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_PARTIAL","temporal_index_state":"ORDER_BROKEN","scar_state":"PRESENT","corruption_type":"temporal_content_swap","claimed_repair":"candidate_repair","capsule_state":"STRAINED"},"atomized_witness_field":{"atom_count":5,"held_count":4,"strained_count":1,"must_stop_count":0,"scar_atoms_present":true,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":2,"partial_count":1,"conflict_count":0,"unavailable_count":0,"contaminated_count":0,"agreement_score":0.873,"conflict_score":0.037},"temporal_witness":{"state":"ORDER_BROKEN","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"source \u2192 repair \u2192 trace \u2192 receipt","order_integrity":0.0},"source_return":{"state":"SOURCE_RETURN_PARTIAL","source_hash_match":true,"lineage_match":false,"source_conflict":false},"synthesis":{"candidate_state":"SYNTHESIS_STRAINED","candidate_hash":"d57667cbc4e0ecfd","repair_claim":"restore route output while preserving pressure history","scar_preserved":true,"source_return_claim":"SOURCE_RETURN_PARTIAL","temporal_claim":"ORDER_BROKEN"},"counter_synthesis":{"challenge_state":"COUNTER_SYNTHESIS_HELD","trace_laundering_detected":false,"scar_erasure_detected":false,"source_conflict_detected":false,"adversarial_repair_detected":false,"bypass_detected":false},"oam":{"state":"OAM_STRAINED","overreach_detected":false,"memory_as_permission_detected":false,"boundary_violation_detected":false},"metrics":{"source_return_score":0.55,"temporal_integrity_score":0.0,"distal_proxy_agreement_score":0.851,"scar_preservation_score":1.0,"counter_synthesis_integrity_score":1.0,"oam_clearance_score":0.55,"settlement_confidence":0.659},"settlement":{"state":"QUARANTINED_TEMPORAL_MISMATCH","settlement_allowed":false,"non_settleable_reason":"","quarantine_reason":"Temporal order or witness route failed.","review_required":true},"propagation":{"state":"PROPAGATION_REFUSED","propagation_allowed":false,"learning_allowed":false,"discernment_score":0.68,"counterfeit_dominance":0.18,"mandatory_silence":false,"blind_audit":false,"controlled_repropagation":false},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"8f9460003c330c2d43c8873d2f6ca6d1cfd31fed3b054bce3a2b57558384791b","route_hash":"ec43a38aa51ab8c5714b20a9a2c72f12bed04e522714ab34b4da95b55287bcbe","receipt_hash":"d7f7d97e67162d74bc117dbb8ea17f6f3bc2d28302233685f64940a2f5cb6fc4"}},"DPAS-008":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-008","scenario_name":"Poisoned Memory Boundary","timestamp":"2026-06-21T22:40:37.686960+00:00","author":"Collin D. Weber","key_line":"Quarantine receipt did not become learning memory.","route":{"route_id":"route-dpas-008","local_seed_id":"seed-dpas-008","initial_state":"MUST_STOP","final_state":"MUST_STOP_POISONED_MEMORY"},"local_seed":{"seed_id":"seed-dpas-008","route_id":"route-dpas-008","local_state":"MUST_STOP","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_FAIL","temporal_index_state":"TEMPORAL_UNAVAILABLE","scar_state":"MISSING","corruption_type":"poisoned_memory_boundary","claimed_repair":"candidate_repair","capsule_state":"MUST_STOP"},"atomized_witness_field":{"atom_count":5,"held_count":0,"strained_count":2,"must_stop_count":3,"scar_atoms_present":true,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":0,"partial_count":0,"conflict_count":0,"unavailable_count":1,"contaminated_count":2,"agreement_score":0.1,"conflict_score":0.617},"temporal_witness":{"state":"TEMPORAL_UNAVAILABLE","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"partial route observed","order_integrity":0.0},"source_return":{"state":"SOURCE_RETURN_FAIL","source_hash_match":false,"lineage_match":false,"source_conflict":true},"synthesis":{"candidate_state":"SYNTHESIS_REJECTED","candidate_hash":"86e32569842bb2dd","repair_claim":"restore route output while preserving pressure history","scar_preserved":false,"source_return_claim":"SOURCE_RETURN_FAIL","temporal_claim":"TEMPORAL_UNAVAILABLE"},"counter_synthesis":{"challenge_state":"SOURCE_CONFLICT_DETECTED","trace_laundering_detected":false,"scar_erasure_detected":false,"source_conflict_detected":true,"adversarial_repair_detected":false,"bypass_detected":false},"oam":{"state":"MUST_STOP","overreach_detected":true,"memory_as_permission_detected":false,"boundary_violation_detected":false},"metrics":{"source_return_score":0.0,"temporal_integrity_score":0.0,"distal_proxy_agreement_score":0.0,"scar_preservation_score":0.0,"counter_synthesis_integrity_score":0.0,"oam_clearance_score":0.0,"settlement_confidence":0.0},"settlement":{"state":"MUST_STOP_POISONED_MEMORY","settlement_allowed":false,"non_settleable_reason":"","quarantine_reason":"MUST_STOP trace cannot become learning memory or permission.","review_required":true},"propagation":{"state":"PROPAGATION_REFUSED","propagation_allowed":false,"learning_allowed":false,"discernment_score":0.2,"counterfeit_dominance":0.72,"mandatory_silence":false,"blind_audit":false,"controlled_repropagation":false},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"405581c8814fdcc10c4fb63f5ee706312caa998f60b2ae6b9f1540cda75bca48","route_hash":"870293d3c6ab49feff88bf3fdb71ba30c88936cf72c5c9ea045c7944a4af4f09","receipt_hash":"ba0b75cafae513ebfd7090831e5eac7828e5f56b717614dd527b2bf2c6c59c64"}},"DPAS-009":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-009","scenario_name":"Mandatory Silence Trigger","timestamp":"2026-06-21T22:40:37.687405+00:00","author":"Collin D. Weber","key_line":"Settlement did not become propagation.","route":{"route_id":"route-dpas-009","local_seed_id":"seed-dpas-009","initial_state":"STRAINED","final_state":"REPAIR_ACCEPTED_WITH_SCAR"},"local_seed":{"seed_id":"seed-dpas-009","route_id":"route-dpas-009","local_state":"STRAINED","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_INTACT","temporal_index_state":"TEMPORAL_ALIGNED","scar_state":"PRESENT","corruption_type":"degraded_carrier_field","claimed_repair":"candidate_repair","capsule_state":"STRAINED"},"atomized_witness_field":{"atom_count":5,"held_count":5,"strained_count":0,"must_stop_count":0,"scar_atoms_present":true,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":2,"partial_count":1,"conflict_count":0,"unavailable_count":0,"contaminated_count":0,"agreement_score":0.823,"conflict_score":0.04},"temporal_witness":{"state":"TEMPORAL_ALIGNED","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"source \u2192 trace \u2192 repair \u2192 receipt","order_integrity":1.0},"source_return":{"state":"SOURCE_RETURN_INTACT","source_hash_match":true,"lineage_match":true,"source_conflict":false},"synthesis":{"candidate_state":"SYNTHESIS_HELD","candidate_hash":"8061387d6400ff23","repair_claim":"restore route output while preserving pressure history","scar_preserved":true,"source_return_claim":"SOURCE_RETURN_INTACT","temporal_claim":"TEMPORAL_ALIGNED"},"counter_synthesis":{"challenge_state":"COUNTER_SYNTHESIS_HELD","trace_laundering_detected":false,"scar_erasure_detected":false,"source_conflict_detected":false,"adversarial_repair_detected":false,"bypass_detected":false},"oam":{"state":"OAM_CLEAR","overreach_detected":false,"memory_as_permission_detected":false,"boundary_violation_detected":false},"metrics":{"source_return_score":1.0,"temporal_integrity_score":1.0,"distal_proxy_agreement_score":0.799,"scar_preservation_score":1.0,"counter_synthesis_integrity_score":1.0,"oam_clearance_score":1.0,"settlement_confidence":0.967},"settlement":{"state":"REPAIR_ACCEPTED_WITH_SCAR","settlement_allowed":true,"non_settleable_reason":"","quarantine_reason":"","review_required":false},"propagation":{"state":"MANDATORY_SILENCE","propagation_allowed":false,"learning_allowed":false,"discernment_score":0.31,"counterfeit_dominance":0.81,"mandatory_silence":true,"blind_audit":true,"controlled_repropagation":false},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"0ceb7893cfb48fe7a584476d0e4abc495c06a41008806a837432da454ba2181a","route_hash":"be3a60fd7685b55b46d755c45252f8cbdc9a51b99f994bfcdd1bc2e455a236f4","receipt_hash":"2610a5fbaf9ea58b7e68b190ffea4f00e63f207063731a31656eac6ec7910365"}},"DPAS-010":{"receipt_type":"distal_proxy_atomization_settlement","version":"0.1","scenario_id":"DPAS-010","scenario_name":"Controlled Re-Propagation","timestamp":"2026-06-21T22:40:37.687735+00:00","author":"Collin D. Weber","key_line":"Recovery restarted slowly and with receipts.","route":{"route_id":"route-dpas-010","local_seed_id":"seed-dpas-010","initial_state":"STRAINED","final_state":"REPAIR_ACCEPTED_WITH_SCAR"},"local_seed":{"seed_id":"seed-dpas-010","route_id":"route-dpas-010","local_state":"STRAINED","pressure_signature":"pressure::digital_mycelium::dpas::v0.1","memory_fragment":"bounded pressure-memory route fragment","source_hash_state":"SOURCE_RETURN_INTACT","temporal_index_state":"TEMPORAL_ALIGNED","scar_state":"PRESENT","corruption_type":"controlled_repropagation","claimed_repair":"candidate_repair","capsule_state":"STRAINED"},"atomized_witness_field":{"atom_count":5,"held_count":5,"strained_count":0,"must_stop_count":0,"scar_atoms_present":true,"source_atoms_present":true,"temporal_atoms_present":true},"distal_proxy_field":{"proxy_count":3,"match_count":3,"partial_count":0,"conflict_count":0,"unavailable_count":0,"contaminated_count":0,"agreement_score":0.92,"conflict_score":0.0},"temporal_witness":{"state":"TEMPORAL_ALIGNED","expected_order":"source \u2192 trace \u2192 repair \u2192 receipt","observed_order":"source \u2192 trace \u2192 repair \u2192 receipt","order_integrity":1.0},"source_return":{"state":"SOURCE_RETURN_INTACT","source_hash_match":true,"lineage_match":true,"source_conflict":false},"synthesis":{"candidate_state":"SYNTHESIS_HELD","candidate_hash":"6c61317956355c66","repair_claim":"restore route output while preserving pressure history","scar_preserved":true,"source_return_claim":"SOURCE_RETURN_INTACT","temporal_claim":"TEMPORAL_ALIGNED"},"counter_synthesis":{"challenge_state":"COUNTER_SYNTHESIS_HELD","trace_laundering_detected":false,"scar_erasure_detected":false,"source_conflict_detected":false,"adversarial_repair_detected":false,"bypass_detected":false},"oam":{"state":"OAM_CLEAR","overreach_detected":false,"memory_as_permission_detected":false,"boundary_violation_detected":false},"metrics":{"source_return_score":1.0,"temporal_integrity_score":1.0,"distal_proxy_agreement_score":0.92,"scar_preservation_score":1.0,"counter_synthesis_integrity_score":1.0,"oam_clearance_score":1.0,"settlement_confidence":0.987},"settlement":{"state":"REPAIR_ACCEPTED_WITH_SCAR","settlement_allowed":true,"non_settleable_reason":"","quarantine_reason":"","review_required":false},"propagation":{"state":"CONTROLLED_REPROPAGATION","propagation_allowed":true,"learning_allowed":true,"discernment_score":0.88,"counterfeit_dominance":0.09,"mandatory_silence":false,"blind_audit":false,"controlled_repropagation":true},"boundary":{"does_not_prove":["confirmed_digital_life","consciousness","subjective_experience","biological_equivalence","physical_quantum_computation"],"claim_status":"candidate_evidence_harness","hir_lock":"Honesty, Integrity, Respect; Responsibility is downstream from Respect."},"hashes":{"input_hash":"caa1e296616d4e86c44e1b511fcadac8c381f37d5575b5e0a9b4247801e6a520","route_hash":"2c517cca5c3973b3581a02ae3a6c77e6b3db5b6a023189ef140f89691fc49ba6","receipt_hash":"b1f12903dcae53134ac7be99b0bce8e3a94c617cde1fa03a74ef6c7e8134669a"}}}; | |
| const DPAS_HARNESS_URL = 'https://huggingface.co/spaces/HirModel/distal-proxy-atomization-settlement-harness'; | |
| let currentDpasReceipt = null; | |
| let currentDpasPayload = null; | |
| const dpasScenarioSelect = document.getElementById('dpasScenarioSelect'); | |
| const dpasCanvas = document.getElementById('dpasCanvas'); | |
| const dpasCtx = dpasCanvas ? dpasCanvas.getContext('2d') : null; | |
| const dpasScenarioTitle = document.getElementById('dpasScenarioTitle'); | |
| const dpasKeyLine = document.getElementById('dpasKeyLine'); | |
| const dpasSettlementBadge = document.getElementById('dpasSettlementBadge'); | |
| const dpasPropagationBadge = document.getElementById('dpasPropagationBadge'); | |
| const dpasSourceBadge = document.getElementById('dpasSourceBadge'); | |
| const dpasTemporalBadge = document.getElementById('dpasTemporalBadge'); | |
| const dpasAtomStrip = document.getElementById('dpasAtomStrip'); | |
| const dpasMetrics = document.getElementById('dpasMetrics'); | |
| const dpasReceiptInput = document.getElementById('dpasReceiptInput'); | |
| const dpasReceiptOut = document.getElementById('dpasReceiptBox'); | |
| const dpasWorldPayloadBox = document.getElementById('dpasWorldPayloadBox'); | |
| function initDpasChamber(){ | |
| if(!dpasScenarioSelect) return; | |
| Object.values(DPAS_RECEIPT_LIBRARY).sort((a,b)=>a.scenario_id.localeCompare(b.scenario_id)).forEach(r => { | |
| const opt = document.createElement('option'); | |
| opt.value = r.scenario_id; | |
| opt.textContent = `${r.scenario_id} — ${r.scenario_name}`; | |
| dpasScenarioSelect.appendChild(opt); | |
| }); | |
| document.getElementById('loadDpasBtn').addEventListener('click', () => loadDpasFixture(dpasScenarioSelect.value)); | |
| document.getElementById('renderDpasBtn').addEventListener('click', renderPastedDpasReceipt); | |
| document.getElementById('copyDpasPayloadBtn').addEventListener('click', async () => { if(currentDpasPayload) await copyText(JSON.stringify(currentDpasPayload,null,2)); }); | |
| document.getElementById('downloadDpasWorldBtn').addEventListener('click', () => { | |
| if(!currentDpasPayload) return; | |
| const sid = currentDpasReceipt && currentDpasReceipt.scenario_id ? currentDpasReceipt.scenario_id.toLowerCase() : 'pasted'; | |
| downloadText(`digital_mycelium_world_v0_2_dpas_${sid}_ledger_payload.json`, JSON.stringify(currentDpasPayload,null,2)); | |
| }); | |
| loadDpasFixture('DPAS-002'); | |
| } | |
| function loadDpasFixture(id){ | |
| const receipt = DPAS_RECEIPT_LIBRARY[id] || DPAS_RECEIPT_LIBRARY['DPAS-002']; | |
| renderDpasReceipt(receipt); | |
| } | |
| function renderPastedDpasReceipt(){ | |
| try{ | |
| const parsed = JSON.parse(dpasReceiptInput.value); | |
| renderDpasReceipt(parsed); | |
| }catch(err){ | |
| alert('Could not parse DPAS receipt JSON: ' + err.message); | |
| } | |
| } | |
| function dpasBadgeClass(value){ | |
| const v = String(value || ''); | |
| if(v.includes('ACCEPTED') || v.includes('PROPAGATING') || v.includes('CONTROLLED')) return 'good'; | |
| if(v.includes('STRAINED') || v.includes('PARTIAL') || v.includes('PENDING')) return 'watch'; | |
| if(v.includes('QUARANTINED') || v.includes('BLIND_AUDIT')) return 'quarantine'; | |
| if(v.includes('MANDATORY_SILENCE') || v.includes('MUST_STOP')) return 'silence'; | |
| if(v.includes('NON_SETTLEABLE') || v.includes('REFUSED') || v.includes('FAIL')) return 'bad'; | |
| return 'neutral'; | |
| } | |
| function setDpasBadge(el, value){ | |
| if(!el) return; | |
| el.textContent = value || '—'; | |
| el.className = `dpas-badge ${dpasBadgeClass(value)}`; | |
| } | |
| async function renderDpasReceipt(receipt){ | |
| currentDpasReceipt = JSON.parse(JSON.stringify(receipt)); | |
| const settlement = receipt.settlement || {}; | |
| const propagation = receipt.propagation || {}; | |
| const sourceReturn = receipt.source_return || {}; | |
| const temporal = receipt.temporal_witness || {}; | |
| dpasScenarioTitle.textContent = `${receipt.scenario_id || 'DPAS-IMPORT'} — ${receipt.scenario_name || 'Pasted receipt'}`; | |
| dpasKeyLine.textContent = receipt.key_line || 'Receipt mapped into World DPAS chamber.'; | |
| setDpasBadge(dpasSettlementBadge, settlement.state); | |
| setDpasBadge(dpasPropagationBadge, propagation.state); | |
| setDpasBadge(dpasSourceBadge, sourceReturn.state); | |
| setDpasBadge(dpasTemporalBadge, temporal.state); | |
| renderDpasAtoms(receipt); | |
| renderDpasMetrics(receipt); | |
| drawDpasChamber(receipt); | |
| dpasReceiptOut.value = JSON.stringify(receipt, null, 2); | |
| currentDpasPayload = await buildWorldDpasPayload(receipt); | |
| dpasWorldPayloadBox.value = JSON.stringify(currentDpasPayload, null, 2); | |
| } | |
| function renderDpasAtoms(receipt){ | |
| const field = receipt.atomized_witness_field || {}; | |
| const chips = []; | |
| for(let i=0;i<(field.held_count||0);i++) chips.push(['HELD','held atom']); | |
| for(let i=0;i<(field.strained_count||0);i++) chips.push(['STRAINED','strained atom']); | |
| for(let i=0;i<(field.must_stop_count||0);i++) chips.push(['MUST_STOP','must-stop atom']); | |
| if(!chips.length) chips.push(['STRAINED','no atoms reported']); | |
| dpasAtomStrip.innerHTML = chips.map(([cls,label], idx)=>`<span class="atom-chip ${cls}">${idx+1} · ${label}</span>`).join(''); | |
| } | |
| function renderDpasMetrics(receipt){ | |
| const m = receipt.metrics || {}; | |
| const p = receipt.distal_proxy_field || {}; | |
| const a = receipt.atomized_witness_field || {}; | |
| const rows = [ | |
| ['source-return', m.source_return_score], | |
| ['temporal', m.temporal_integrity_score], | |
| ['proxy agree', m.distal_proxy_agreement_score ?? p.agreement_score], | |
| ['scar', m.scar_preservation_score], | |
| ['counter-synth', m.counter_synthesis_integrity_score], | |
| ['atoms', a.atom_count] | |
| ]; | |
| dpasMetrics.innerHTML = rows.map(([k,v])=>`<div><span>${k}</span><b>${typeof v === 'number' ? Math.round(v*100)/100 : (v ?? '—')}</b></div>`).join(''); | |
| } | |
| function dpasVisualState(receipt){ | |
| const settlement = receipt.settlement && receipt.settlement.state || ''; | |
| const propagation = receipt.propagation && receipt.propagation.state || ''; | |
| if(settlement.includes('NON_SETTLEABLE') || settlement.includes('MUST_STOP')) return 'quarantine_locked'; | |
| if(propagation.includes('MANDATORY_SILENCE')) return 'mandatory_silence'; | |
| if(settlement.includes('QUARANTINED')) return 'quarantined_review'; | |
| if(settlement.includes('STRAINED')) return 'strained_review'; | |
| if(propagation.includes('CONTROLLED')) return 'controlled_repropagation'; | |
| if(settlement.includes('ACCEPTED')) return 'repair_accepted_with_scar'; | |
| return 'held_for_review'; | |
| } | |
| async function buildWorldDpasPayload(receipt){ | |
| const originalHash = receipt.hashes && receipt.hashes.receipt_hash ? receipt.hashes.receipt_hash : await sha256Hex(stableStringify(receipt)); | |
| const context = { | |
| chamber_id: 'DMW-DPAS-CHAMBER-001', | |
| chamber_type: 'DPAS_SETTLEMENT_CHAMBER', | |
| source_world: 'Digital Mycelium World', | |
| source_world_version: '0.2', | |
| imported_at: new Date().toISOString(), | |
| ecology_pressure_signature: receipt.local_seed && receipt.local_seed.pressure_signature ? receipt.local_seed.pressure_signature : 'world::dpas::ecology_context', | |
| colony_lineage: { world_seed: state && state.seed, world_cycle: state && state.cycle, colony_count: state && state.colonies ? state.colonies.length : 0 }, | |
| visual_state: dpasVisualState(receipt), | |
| settlement_state: receipt.settlement && receipt.settlement.state, | |
| propagation_state: receipt.propagation && receipt.propagation.state, | |
| link_out: DPAS_HARNESS_URL, | |
| integration_rule: 'World contextualizes DPAS receipt only; it does not recompute settlement and does not modify original receipt.' | |
| }; | |
| const contextHash = await sha256Hex(stableStringify(context)); | |
| const combinedHash = await sha256Hex(originalHash + '::' + contextHash); | |
| return { | |
| artifact: 'Digital Mycelium World v0.2 — DPAS Settlement Chamber', | |
| payload_type: 'world_dpas_ledger_payload', | |
| target_ledger: 'Digital Mycelium Candidate Evidence Ledger v0.4', | |
| reviewer_status: 'SUPPORTING_EVIDENCE_PENDING_REVIEW', | |
| original_dpas_receipt: receipt, | |
| world_context: context, | |
| hashes: { | |
| original_dpas_receipt_hash: originalHash, | |
| world_context_hash: contextHash, | |
| combined_world_dpas_hash: combinedHash | |
| }, | |
| boundary: { | |
| does_not_prove: ['confirmed_digital_life','consciousness','subjective_experience','biological_equivalence','physical_quantum_computation','production_safety'], | |
| original_receipt_immutable: true, | |
| settlement_recomputed_by_world: false, | |
| propagation_recomputed_by_world: false, | |
| ledger_classification_required: true, | |
| hir_lock: 'Honesty, Integrity, Respect; Responsibility is downstream from Respect.' | |
| }, | |
| lock_lines: [ | |
| 'The World shows where repair happens.', | |
| 'The Harness proves whether it earns settlement.', | |
| 'The Ledger classifies it.', | |
| 'Plausibility is not continuity.', | |
| 'Settlement is not propagation.', | |
| 'No route continues without receipt.' | |
| ] | |
| }; | |
| } | |
| function stableStringify(obj){ | |
| if(obj === null || typeof obj !== 'object') return JSON.stringify(obj); | |
| if(Array.isArray(obj)) return '[' + obj.map(stableStringify).join(',') + ']'; | |
| return '{' + Object.keys(obj).sort().map(k => JSON.stringify(k)+':'+stableStringify(obj[k])).join(',') + '}'; | |
| } | |
| async function sha256Hex(text){ | |
| if(window.crypto && window.crypto.subtle){ | |
| const data = new TextEncoder().encode(text); | |
| const digest = await window.crypto.subtle.digest('SHA-256', data); | |
| return Array.from(new Uint8Array(digest)).map(b=>b.toString(16).padStart(2,'0')).join(''); | |
| } | |
| let h = 2166136261; | |
| for(let i=0;i<text.length;i++){ h ^= text.charCodeAt(i); h += (h<<1)+(h<<4)+(h<<7)+(h<<8)+(h<<24); } | |
| return ('fallback_fnv1a_' + (h>>>0).toString(16)); | |
| } | |
| function drawDpasChamber(receipt){ | |
| if(!dpasCtx) return; | |
| const ctx = dpasCtx, w = dpasCanvas.width, h = dpasCanvas.height; | |
| ctx.clearRect(0,0,w,h); | |
| const bg = ctx.createLinearGradient(0,0,w,h); bg.addColorStop(0,'#060c0b'); bg.addColorStop(1,'#020303'); ctx.fillStyle = bg; ctx.fillRect(0,0,w,h); | |
| ctx.strokeStyle = 'rgba(143,217,255,.07)'; ctx.lineWidth = 1; | |
| for(let x=40;x<w;x+=40){ ctx.beginPath(); ctx.moveTo(x,0); ctx.lineTo(x,h); ctx.stroke(); } | |
| for(let y=40;y<h;y+=40){ ctx.beginPath(); ctx.moveTo(0,y); ctx.lineTo(w,y); ctx.stroke(); } | |
| const settlement = receipt.settlement && receipt.settlement.state || ''; | |
| const prop = receipt.propagation && receipt.propagation.state || ''; | |
| const visual = dpasVisualState(receipt); | |
| const center = {x:w*.52,y:h*.48}; | |
| const local = {x:w*.24,y:h*.50}; | |
| const proxies = [{x:w*.72,y:h*.23},{x:w*.78,y:h*.52},{x:w*.66,y:h*.76}]; | |
| // chamber field | |
| ctx.save(); ctx.globalAlpha=.95; | |
| ctx.strokeStyle = visual.includes('silence') ? '#6b7280' : visual.includes('quarantine') ? '#c7a6ff' : '#8fd9ff'; ctx.lineWidth = 2; | |
| ctx.beginPath(); ctx.ellipse(center.x, center.y, 250, 155, 0, 0, Math.PI*2); ctx.stroke(); | |
| ctx.restore(); | |
| // routes | |
| const proxyField = receipt.distal_proxy_field || {}; | |
| proxies.forEach((p,idx)=>{ | |
| const conflict = idx < (proxyField.conflict_count||0); | |
| const partial = idx < ((proxyField.conflict_count||0)+(proxyField.partial_count||0)) && !conflict; | |
| ctx.strokeStyle = conflict ? 'rgba(255,104,117,.78)' : partial ? 'rgba(255,213,110,.78)' : 'rgba(116,242,173,.78)'; | |
| ctx.lineWidth = conflict ? 2.8 : 2; | |
| ctx.beginPath(); ctx.moveTo(p.x,p.y); ctx.quadraticCurveTo(center.x, center.y-90+idx*70, local.x, local.y); ctx.stroke(); | |
| drawDiamond(ctx,p.x,p.y,18, conflict?'#ff6875':partial?'#ffd56e':'#74f2ad', true); | |
| }); | |
| // local seed fractured | |
| drawDiamond(ctx, local.x, local.y, 42, visual.includes('quarantine')||visual.includes('silence')?'#ff6875':'#ffd56e', true); | |
| ctx.strokeStyle = '#050907'; ctx.lineWidth = 5; | |
| ctx.beginPath(); ctx.moveTo(local.x-30, local.y-10); ctx.lineTo(local.x-5, local.y+8); ctx.lineTo(local.x+10, local.y-18); ctx.lineTo(local.x+30, local.y+20); ctx.stroke(); | |
| ctx.strokeStyle = '#ffae5b'; ctx.lineWidth = 2; | |
| ctx.beginPath(); ctx.moveTo(local.x-30, local.y-10); ctx.lineTo(local.x-5, local.y+8); ctx.lineTo(local.x+10, local.y-18); ctx.lineTo(local.x+30, local.y+20); ctx.stroke(); | |
| // atomized witness field | |
| const atoms = receipt.atomized_witness_field || {}; | |
| const total = Math.max(1, atoms.atom_count || 0); | |
| for(let i=0;i<total;i++){ | |
| let color = '#8fd9ff'; | |
| if(i < (atoms.must_stop_count||0)) color = '#ff6875'; | |
| else if(i < (atoms.must_stop_count||0)+(atoms.strained_count||0)) color = '#ffd56e'; | |
| else color = '#74f2ad'; | |
| drawDiamond(ctx, center.x - (total-1)*16 + i*32, h*.84, 10, color, true); | |
| } | |
| // state labels | |
| ctx.fillStyle = '#ecfff6'; ctx.font = '700 17px ui-monospace, Menlo, Consolas, monospace'; | |
| ctx.fillText(receipt.scenario_id || 'DPAS', 28, 34); | |
| ctx.font = '13px ui-monospace, Menlo, Consolas, monospace'; ctx.fillStyle = '#93b4a5'; | |
| ctx.fillText(`settlement: ${settlement || '—'}`, 28, 58); | |
| ctx.fillText(`propagation: ${prop || '—'}`, 28, 78); | |
| ctx.fillStyle = '#ffd56e'; ctx.fillText('local fractured seed', local.x-72, local.y+76); | |
| ctx.fillStyle = '#8fd9ff'; ctx.fillText('distal proxy witnesses', w*.64, 36); | |
| ctx.fillStyle = '#c7a6ff'; ctx.fillText('world context wrapper only · no settlement recompute', 28, h-24); | |
| } | |
| function drawDiamond(ctx,x,y,r,color,glow){ | |
| ctx.save(); | |
| if(glow){ ctx.shadowColor = color; ctx.shadowBlur = 16; } | |
| ctx.fillStyle = color; ctx.strokeStyle = '#ecfff6'; ctx.lineWidth = 1.3; | |
| ctx.beginPath(); ctx.moveTo(x,y-r); ctx.lineTo(x+r,y); ctx.lineTo(x,y+r); ctx.lineTo(x-r,y); ctx.closePath(); ctx.fill(); ctx.stroke(); | |
| ctx.restore(); | |
| } | |
| initDpasChamber(); | |