Intelligence, Advanced Charting & Trading Platform
diagnostics/chartnova-stage2-v27-preview-2026-10-15
diagnostics/chartnova-blank-screen-2026-10-15
diagnostics/chartnova-stage2-v27-preview-2026-10-15
docs/chartnova-stage1-reconcile-manifest-2026-10-15
feature/chartnova-ios-widget
feature/chartnova-light-catalog-lazy-series-2026-10-15
feature/chartnova-market-terminal
feature/chartnova-multimarket-chart-ws-foundation
feature/chartnova-neon-direct-history
feature/chartnova-neon-history
feature/paper-trading-risk-controls-2026-10-14
fix/alpha-vantage-live-payload
fix/chartnova-progressive-loading-2026-10-15
fix/live-proof-runner-cwd-2026-10-14
foundation/phase-0
foundation/postgres-core
main
ops/chartnova-emergency-rollback-2026-10-15
phase-1/candle-builder
phase-1/data-proof-artifact
phase-1/data-proof-metrics
phase-1/data-proof-report
phase-1/external-gates-state
phase-1/gold-api-fallback
phase-1/ingestion-pipeline
phase-1/live-proof-runner
phase-1/market-calendar
phase-1/market-domain
phase-1/neon-live-proof
phase-1/persistence-contract
phase-1/postgres-ci
phase-1/provider-adapters
phase-1/provider-recovery
phase-1/quality-propagation
phase-1/spike-detection
phase-1/xau-provider-adapter
risk/chartnova-alert-runtime-atomic-2026-10-22
risk/chartnova-atomic-outbox-2026-10-22
risk/chartnova-seven-track-safety-2026-10-21
safety/p0-triage-2026-10-13
| 1 | /** |
| 2 | * Version-specific read-only public-asset parity diagnostic. |
| 3 | * No production or Cloudflare API mutation; hashes PUBLIC frontend assets only. |
| 4 | * v26 and v27 Preview are separate ephemeral origins, not production deployment. |
| 5 | */ |
| 6 | import {createHash} from 'node:crypto'; |
| 7 | import {Script} from 'node:vm'; |
| 8 | const workers=[ |
| 9 | {label:'v26',url:'https://85177f9d-velyqor-preview.davoodmehraban89.workers.dev/'}, |
| 10 | {label:'v27',url:'https://2cbeb4e2-velyqor-preview.davoodmehraban89.workers.dev/'} |
| 11 | ]; |
| 12 | async function safeGet(url){ |
| 13 | for(let n=0;n<3;n++){ |
| 14 | try{ |
| 15 | const result=await fetch(url,{signal:AbortSignal.timeout(16000)}); |
| 16 | if(result.ok) return result.text(); |
| 17 | }catch{} |
| 18 | if(n<2)await new Promise(resolve=>setTimeout(resolve,(n+1)*700)); |
| 19 | } |
| 20 | throw Error('PUBLIC_ASSET_UNAVAILABLE'); |
| 21 | } |
| 22 | function hash(s){return createHash('sha256').update(s,'utf8').digest('hex')} |
| 23 | function scriptFrom(html){ |
| 24 | const scripts=[...html.matchAll(/<script>([\s\S]*?)<\/script>/g)]; |
| 25 | if(scripts.length!==1)throw Error('Unexpected number of inline scripts'); |
| 26 | new Script(scripts[0][1]); |
| 27 | return scripts[0][1]; |
| 28 | } |
| 29 | const assets=await Promise.all(workers.map(async w=>{ |
| 30 | const [html,sw]=await Promise.all([safeGet(w.url),safeGet(w.url+'sw.js')]); |
| 31 | const script=scriptFrom(html); |
| 32 | if(!html.includes('class="shell"')||!sw.includes('chartnova-v1'))throw Error('Unexpected app asset'); |
| 33 | return { |
| 34 | label:w.label,url:w.url,html,sw,script, |
| 35 | hash:{html:hash(html),sw:hash(sw),inlineJS:hash(script)}, |
| 36 | bytes:{html:Buffer.byteLength(html),sw:Buffer.byteLength(sw),script:Buffer.byteLength(script)} |
| 37 | }; |
| 38 | })); |
| 39 | const [v26,v27]=assets; |
| 40 | const stripScript=h=>h.replace(/<script>[\s\S]*?<\/script>/, |
| 41 | '<script>__INLINE_JS_VERSION_SLOT__</script>'); |
| 42 | const outerEqual=stripScript(v26.html)===stripScript(v27.html); |
| 43 | const swEqual=v26.sw===v27.sw; |
| 44 | const expectedPatch=v27.script.includes('chartnovaRefreshInFlight')&& |
| 45 | !v26.script.includes('chartnovaRefreshInFlight'); |
| 46 | const result={ |
| 47 | verdict:swEqual&&outerEqual&&expectedPatch?'FRONTEND_SCOPE_CONFIRMED':'DIFFERENCE_REQUIRES_REVIEW', |
| 48 | liveDeploymentNotChanged:true, |
| 49 | originalWorkerBackendNotCompared:true, |
| 50 | previewVersions:assets.map(({label,url,hash,bytes})=>({label,url,sha256:hash,bytes})), |
| 51 | serviceWorkerByteIdentical:swEqual, |
| 52 | htmlOutsideInlineJavascriptIdentical:outerEqual, |
| 53 | expectedJavascriptPatchMarker:expectedPatch |
| 54 | }; |
| 55 | console.log('CHARTNOVA_V26_V27_PUBLIC_ASSET_DIFF '+JSON.stringify(result)); |
| 56 | if(!swEqual||!outerEqual||!expectedPatch)process.exitCode=1; |