Block fallback form leaks and add the tested untuned strict candidate
Browse filesFiles changed (14)
- LEAK-AUDIT.mdAdded+16
- METHODS.md+3
- MODEL-STUDY.md+3
- README.md+2
- SECURITY-REVIEW.md+3
- VERIFICATION.md+3
- app.js+3-3
- index.html+4-4
- leakage-audit.zipAdded+3
- model.js+3-3
- test_privacy_policy.cjsAdded+12
- test_validation_model.cjs+10
- test_worker.cjs+1-1
- worker.js+1-1
12345678910111213141516# Leakage, overfitting and accuracy audit — 27 October 2026
A conditional privacy defect was fixed: native forms could submit named inputs to the hosting URL if JavaScript failed. The page now sets CSP form-action 'none'. Normal JavaScript calculations prevent native submission and still work. Source review found no normal-flow upload, telemetry or persistent storage. Browser/hosting/extension behavior remains outside this bounded source audit. Local exports deliberately contain data-derived information; sharing them can disclose it.
Independent causal checks before and after the model change:32 runs,24 future-suffix mutations,6,778 unchanged forecasts through the first affected target,31,162 earlier feature rows unchanged,47 eligible fold snapshots unchanged,24 own-label checks,16 latest-parameter checks, and48 strict training-only scaler cells matched. No future-answer leakage was found in those probes. EWMA updates from earlier observed outcomes are causal.
One prespecified challenger added unadjusted training frequencies as a strict selection candidate, with temperature fixed at1. All five candidates use the earlier selection block; the final200 outcomes do not choose the method. Development and confirmation each used36 runs: six familiar synthetic mechanisms times six new seeds,1,200 prices per run. Equal-weight mechanism mean log-loss change was−0.0015863365 in development and−0.0017073704 in confirmation. Mean multiclass Brier change was−0.0005015911 and−0.0001603786. Both gates passed; no mechanism exceeded the prespecified0.02 degradation cap. Complete cohort results are included. These are absolute score differences, not percentages or trading returns.
Promoted only in strict mode. Production strict reports exactly matched the tested challenger on three parity fixtures; complete classic reports exactly matched the prior model on those same fixtures. No second challenger was searched this turn. Existing ECB data were already inspected and were not treated as fresh confirmation.
Residual overfitting risks: repeated human inspection, added candidate-selection uncertainty, sparse large-fall examples, familiar synthetic mechanisms, nonstationary real data, and unavailable point-in-time price provenance. New RNG streams do not make these independent market replications. No prospective market-accuracy or profitability improvement is established. Strict holdout is resettable rather than sealed. Classic still reuses calibration/selection data.
All fifteen static test suites passed, including new fail-closed form policy and strict-candidate tests. Tests cover fixed temperature, independently recomputed selection score and strict latest freeze. No native trading engines were installed. Graphify did not run; familiar source was inspected directly.
## ReproduceUse Node.js with no new packages. In this directory run `node study.cjs development`, then `node study.cjs confirmation` (the latter refuses a failed development gate). The study pins model-before.js and instruments its sole challenger. Run `node causality.cjs` and `node scaling.cjs` against model-current.js. Study scripts overwrite corresponding results; preserve supplied files before rerunning if needed. Prior and current source snapshots are included. No private uploaded series are packaged.104 unmodified lines105106107104 unmodified lines## Cost-covering price changeThe cost exercise now reports breakEvenMovePercent=(spreadBps+2*feeBps+2*slippageBps+delayBps)/100 for at least one completed trade. Substitution into the fixed-notional gain/loss equation gives zero net (up to floating-point precision). With no completed trades it reports null and no comparison. This is the completed-trade threshold under chosen assumptions, not a forecast or a threshold for recovering a hypothetical missed opportunity. It is independent of notional and completed count when that count is positive. Values above100% exceed the exercise’s allowed move range and are labeled. Exact values remain in the audit; the display rounds to at most six decimals with a nonzero tiny-value label.104 unmodified lines105106107108109110104 unmodified lines## Cost-covering price changeThe cost exercise now reports breakEvenMovePercent=(spreadBps+2*feeBps+2*slippageBps+delayBps)/100 for at least one completed trade. Substitution into the fixed-notional gain/loss equation gives zero net (up to floating-point precision). With no completed trades it reports null and no comparison. This is the completed-trade threshold under chosen assumptions, not a forecast or a threshold for recovering a hypothetical missed opportunity. It is independent of notional and completed count when that count is positive. Values above100% exceed the exercise’s allowed move range and are labeled. Exact values remain in the audit; the display rounds to at most six decimals with a nonzero tiny-value label.## Strict untuned comparison and leakage auditStrict mode now includes empirical_raw as a fifth candidate with temperature fixed at1. Selection uses its existing earlier selection block, and frozen latest inference follows that choice. Classic forecasting is unchanged. Promotion followed written development/confirmation gates on72 constructed synthetic runs; no market-accuracy claim follows. See [audit and evidence](LEAK-AUDIT.md). The page blocks native form submission through form-action none to protect inputs when JavaScript is unavailable.
53 unmodified lines54555653 unmodified linesReproduction files, the dated public FX snapshot and per-seed results are in [model-study.zip](model-study.zip). The app does not fetch a live market feed.53 unmodified lines54555657585953 unmodified linesReproduction files, the dated public FX snapshot and per-seed results are in [model-study.zip](model-study.zip). The app does not fetch a live market feed.## Subsequent strict-candidate auditA later prespecified test added unadjusted frequencies as a strict selection candidate. Both synthetic development and confirmation gates passed; strict mode now includes it with no fitted temperature. Classic is unchanged. This does not reverse the earlier rejected blend/online-mixture results above or establish a market edge. [Current audit](LEAK-AUDIT.md) and [source/results](leakage-audit.zip).
66 unmodified lines67686966 unmodified linesUnder **Number games**, “Would trading costs change the result?” compares hypothetical gains/losses before costs with a fixed-notional example after assumed missed trades, spread, two-sided fees/slippage and an adverse-delay charge. All inputs are chosen by the user. It does not use forecast probabilities or simulate order-book fills. No third-party execution engine or account connection was added.The cost exercise also shows the price change needed for each finished trade to cover the entered costs. The default is0.27%; this is a hypothetical cost threshold, not an expected return.66 unmodified lines676869707166 unmodified linesUnder **Number games**, “Would trading costs change the result?” compares hypothetical gains/losses before costs with a fixed-notional example after assumed missed trades, spread, two-sided fees/slippage and an adverse-delay charge. All inputs are chosen by the user. It does not use forecast probabilities or simulate order-book fills. No third-party execution engine or account connection was added.The cost exercise also shows the price change needed for each finished trade to cover the entered costs. The default is0.27%; this is a hypothetical cost threshold, not an expected return.Strict mode now lets unadjusted training counts compete alongside the four existing candidates. A [leakage and overfitting audit](LEAK-AUDIT.md) records the conditional form-submission privacy fix, chronological probes and synthetic-only improvement evidence. [Reproducible evidence](leakage-audit.zip) includes pinned before/current model source.
46 unmodified lines47484946 unmodified lines## Cost learning exercisePure bounded finite-number arithmetic runs synchronously in the tab. No network, file ingestion, credentials, account operations, persistent storage or trade placement. Output uses textContent. Exact calculation inputs and assumptions appear only in the local audit. This adds no native trading engine or upstream dependencies.46 unmodified lines47484950515246 unmodified lines## Cost learning exercisePure bounded finite-number arithmetic runs synchronously in the tab. No network, file ingestion, credentials, account operations, persistent storage or trade placement. Output uses textContent. Exact calculation inputs and assumptions appear only in the local audit. This adds no native trading engine or upstream dependencies.## Fail-closed native formsSource audit identified a conditional GET fallback when JavaScript fails: named form values and a selected basename could enter a hosting URL (not the selected file body). Added CSP form-action none; all calculations are JavaScript-local. A regression test asserts the policy alongside same-origin connection/script restrictions. No normal-flow upload or persistent storage was found; provider logs, browser extensions and browser memory remain outside source review. See LEAK-AUDIT.md.
63 unmodified lines64656663 unmodified lines## Cost comparison refinement — 27 October 2026All fourteen static test files passed. New test-first checks verify the0.27% default threshold, zero net when substituted into the arithmetic, zero-friction0%, and no-completion null. Integration checks threshold display, removal on error and focus on excess completed count. Independent review ran extra zero/tiny/extreme probes and found no concrete defect. Local browser verified normal threshold, focused count error and zero-completion message. Local preview initially failed to attach; retry succeeded. No model/worker calculation changed. Graphify did not run; source was inspected directly.63 unmodified lines64656667686963 unmodified lines## Cost comparison refinement — 27 October 2026All fourteen static test files passed. New test-first checks verify the0.27% default threshold, zero net when substituted into the arithmetic, zero-friction0%, and no-completion null. Integration checks threshold display, removal on error and focus on excess completed count. Independent review ran extra zero/tiny/extreme probes and found no concrete defect. Local browser verified normal threshold, focused count error and zero-completion message. Local preview initially failed to attach; retry succeeded. No model/worker calculation changed. Graphify did not run; source was inspected directly.## Leakage and strict accuracy challenger — 27 October2026All fifteen static suites passed. New policy test first failed for missing form-action, then passed after the source fix. New strict candidate test first failed for missing raw candidate, then passed: fixed temperature1 and independently recomputed earlier selection score.72 constructed experiments passed the written development/confirmation gates. New strict report matched the tested challenger exactly and complete classic reports matched prior source for seeds42/61002/71004. Independent post-change causal probes preserved6,778 earlier forecasts over24 suffix mutations;48 strict scaler cells match training-only recomputation. See LEAK-AUDIT.md and leakage-audit.zip.
1 unmodified line234567896 unmodified lines1051061071081091101111121131141151161 unmodified lineconst $=id=>document.getElementById(id),percent=x=>x>0&&x<.0001?'<0.01%':x<1&&x>.9999?'>99.99%':(100*x).toFixed(2)+'%',fmt=x=>Number(x).toFixed(4);let currentReport=null,busy=false,worker=null,focusResults=false,operation=0;let forwardOperation=0,forwardCheck=null;const runCache=QuantCache.createRunCache(),MODEL_REVISION='browser-support-20261027-v5';const inspectionJournal=QuantProvenance.createJournal();const INK='#34343a',BLUE='#0066cc',GRAY='#767680';function escapeXML(value){return String(value).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));}96 unmodified linesfunction syntheticDates(n){const dates=[],day=new Date('2010-01-04T00:00:00Z');while(dates.length<n){if(day.getUTCDay()!==0&&day.getUTCDay()!==6)dates.push(day.toISOString().slice(0,10));day.setUTCDate(day.getUTCDate()+1);}return dates;}async function run(){if(busy)return;const token=++operation;setBusy(true,'Learning from earlier prices, then checking guesses against later prices…');try{let closes,dates,source;const mode=$('data-source').value,protocol=$('validation-protocol').value;if(!['classic','strict'].includes(protocol))throw Error('Choose how to check the guesses.');if(mode==='csv'){const file=$('csv-file').files[0];if(!file)throw Error('Choose a price file with date and close columns, or select Made-up prices.');if(file.size>2*1024*1024)throw Error('CSV must be no larger than 2 MiB.');const buffer=await file.arrayBuffer();if(token!==operation)return;let text;try{text=new TextDecoder('utf-8',{fatal:true,ignoreBOM:true}).decode(buffer);}catch{throw Error('CSV must use valid UTF-8 encoding. Export it as UTF-8 and try again.');}const data=QuantLabs.parseCSV(text);closes=data.closes;dates=data.dates;source={synthetic:false,rows:closes.length,name:'Local CSV',calendar_gap_max_days:data.calendarGapMaxDays,data_quality:data.quality};}else{const n=Number($('observations').value),seed=Number($('seed').value);if(!Number.isInteger(n)||n<850||n>2500||!Number.isInteger(seed)||seed<0||seed>100000)throw Error('Use 850–2,500 observations and an integer seed from 0 to 100,000.');const model=await import('./model.js?v=20261027support1');if(token!==operation)return;closes=globalThis.QuantModel.synthetic(n,seed);dates=syntheticDates(n);source={synthetic:true,rows:n,seed,name:'Browser synthetic generator',calendar:'Weekday placeholders, not exchange dates'};}if(protocol==='strict'&&closes.length<1064)throw Error('The separate test needs at least 1,064 prices. Add more prices, or open How we check the guesses and choose Repeated checks.');const sha256=await QuantProvenance.fingerprint({dates,closes});if(token!==operation)return;const identity={sha256,canonical_format:'quantlab-normalized-prices-v1: JSON array of format tag, ISO dates, finite positive numeric closes',rows:closes.length,first_date:dates[0],last_date:dates.at(-1),last_close:closes.at(-1)};const key=JSON.stringify([MODEL_REVISION,protocol,dates,closes]);const cached=runCache.get(key);if(cached){render(cached.report,source,dates,cached.diagnostics,true,identity);return;}if(worker)worker.terminate();worker=new Worker('worker.js?v=20261027support1');worker.onmessage=event=>{if(token!==operation)return;if(event.data.error){fail(event.data.error);return;}const report=event.data.report;report.predictions.forEach(r=>{r.feature_date=dates[r.feature_index];r.target_date=dates[r.target_index];});report.latest_forecast.feature_date=dates.at(-1);runCache.set(key,{report,diagnostics:event.data.diagnostics});render(report,source,dates,event.data.diagnostics,false,identity);worker.terminate();worker=null;};worker.onerror=()=>{if(token!==operation)return;fail('Browser calculation could not finish. Try fewer observations or download the Python project.');};worker.postMessage({closes,protocol});}catch(error){if(token===operation)fail(error.message);}}$('experiment').addEventListener('invalid',event=>{for(let parent=event.target.parentElement;parent;parent=parent.parentElement){if(parent.tagName==='DETAILS')parent.open=true;}},true);$('experiment').addEventListener('submit',event=>{event.preventDefault();focusResults=true;run();});1 unmodified line234567896 unmodified lines1051061071081091101111121131141151161 unmodified lineconst $=id=>document.getElementById(id),percent=x=>x>0&&x<.0001?'<0.01%':x<1&&x>.9999?'>99.99%':(100*x).toFixed(2)+'%',fmt=x=>Number(x).toFixed(4);let currentReport=null,busy=false,worker=null,focusResults=false,operation=0;let forwardOperation=0,forwardCheck=null;const runCache=QuantCache.createRunCache(),MODEL_REVISION='browser-untuned-20261027-v6';const inspectionJournal=QuantProvenance.createJournal();const INK='#34343a',BLUE='#0066cc',GRAY='#767680';function escapeXML(value){return String(value).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));}96 unmodified linesfunction syntheticDates(n){const dates=[],day=new Date('2010-01-04T00:00:00Z');while(dates.length<n){if(day.getUTCDay()!==0&&day.getUTCDay()!==6)dates.push(day.toISOString().slice(0,10));day.setUTCDate(day.getUTCDate()+1);}return dates;}async function run(){if(busy)return;const token=++operation;setBusy(true,'Learning from earlier prices, then checking guesses against later prices…');try{let closes,dates,source;const mode=$('data-source').value,protocol=$('validation-protocol').value;if(!['classic','strict'].includes(protocol))throw Error('Choose how to check the guesses.');if(mode==='csv'){const file=$('csv-file').files[0];if(!file)throw Error('Choose a price file with date and close columns, or select Made-up prices.');if(file.size>2*1024*1024)throw Error('CSV must be no larger than 2 MiB.');const buffer=await file.arrayBuffer();if(token!==operation)return;let text;try{text=new TextDecoder('utf-8',{fatal:true,ignoreBOM:true}).decode(buffer);}catch{throw Error('CSV must use valid UTF-8 encoding. Export it as UTF-8 and try again.');}const data=QuantLabs.parseCSV(text);closes=data.closes;dates=data.dates;source={synthetic:false,rows:closes.length,name:'Local CSV',calendar_gap_max_days:data.calendarGapMaxDays,data_quality:data.quality};}else{const n=Number($('observations').value),seed=Number($('seed').value);if(!Number.isInteger(n)||n<850||n>2500||!Number.isInteger(seed)||seed<0||seed>100000)throw Error('Use 850–2,500 observations and an integer seed from 0 to 100,000.');const model=await import('./model.js?v=20261027audit1');if(token!==operation)return;closes=globalThis.QuantModel.synthetic(n,seed);dates=syntheticDates(n);source={synthetic:true,rows:n,seed,name:'Browser synthetic generator',calendar:'Weekday placeholders, not exchange dates'};}if(protocol==='strict'&&closes.length<1064)throw Error('The separate test needs at least 1,064 prices. Add more prices, or open How we check the guesses and choose Repeated checks.');const sha256=await QuantProvenance.fingerprint({dates,closes});if(token!==operation)return;const identity={sha256,canonical_format:'quantlab-normalized-prices-v1: JSON array of format tag, ISO dates, finite positive numeric closes',rows:closes.length,first_date:dates[0],last_date:dates.at(-1),last_close:closes.at(-1)};const key=JSON.stringify([MODEL_REVISION,protocol,dates,closes]);const cached=runCache.get(key);if(cached){render(cached.report,source,dates,cached.diagnostics,true,identity);return;}if(worker)worker.terminate();worker=new Worker('worker.js?v=20261027audit1');worker.onmessage=event=>{if(token!==operation)return;if(event.data.error){fail(event.data.error);return;}const report=event.data.report;report.predictions.forEach(r=>{r.feature_date=dates[r.feature_index];r.target_date=dates[r.target_index];});report.latest_forecast.feature_date=dates.at(-1);runCache.set(key,{report,diagnostics:event.data.diagnostics});render(report,source,dates,event.data.diagnostics,false,identity);worker.terminate();worker=null;};worker.onerror=()=>{if(token!==operation)return;fail('Browser calculation could not finish. Try fewer observations or download the Python project.');};worker.postMessage({closes,protocol});}catch(error){if(token===operation)fail(error.message);}}$('experiment').addEventListener('invalid',event=>{for(let parent=event.target.parentElement;parent;parent=parent.parentElement){if(parent.tagName==='DETAILS')parent.open=true;}},true);$('experiment').addEventListener('submit',event=>{event.preventDefault();focusResults=true;run();});
2 unmodified lines3456789101155 unmodified lines676869707172732 unmodified lines<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#f5f5f7"><meta name="description" content="Explore price possibilities with simple examples and clear checks. Runs in your browser."><meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; worker-src 'self'; connect-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'none'"><title>QuantLab · probability research</title><link rel="stylesheet" href="style.css?v=20261027costs2"><script src="labs.js?v=20261027support1" defer></script><script src="cache.js?v=20261027support1" defer></script><script src="scenarios.js" defer></script><script src="provenance.js?v=20261026provenance1" defer></script><script src="forward.js?v=20261027costs2" defer></script><script src="execution.js?v=20261027costs2" defer></script><script src="app.js?v=20261027costs2" defer></script></head><body><a class="skip" href="#results">Skip to results</a>55 unmodified lines<p id="cost-threshold" class="cost-threshold" aria-live="polite"></p><div id="cost-output" class="calculation-result" role="status" aria-live="polite"></div><details><summary>How this story works</summary><p class="hint">Each trade uses the same starting amount. Every finished trade buys and sells once, with the same price change and costs. Unfinished trades are assumed never to fill, so they cost nothing here. All percentages are applied to the starting amount; money is not reinvested. Skipping a losing trade can help. Real orders can fill only partly, and their timing and price can differ.</p><p class="hint">This is arithmetic, not a historical trading test, order-book replay or estimate of future profit. HftBacktest, NautilusTrader and KalshiMarketMaker are not running here.</p><pre id="cost-audit"></pre></details></section></section><section id="distributions" class="view" hidden><h2>What if prices took surprise jumps?</h2><p class="scenario-note">Make a pretend world: prices wiggle and sometimes jump. You choose all the settings. This does not learn from your price file or predict real markets.</p><div class="scenario-layout"><form id="jump-form"><h3>Build a pretend year</h3><label>Yearly growth setting · 0.06 is about 6%<input name="mu" type="number" min="-1" max="1" step="0.01" value="0.06" required></label><label>Yearly wiggle size · 0.20 means 20%<input name="sigma" type="number" min="0.01" max="2" step="0.01" value="0.2" required></label><label>Average surprise jumps per year<input name="intensity" type="number" min="0" max="50" step="0.5" value="2" required></label><label>Average jump · log units<input name="jumpMean" type="number" min="-1" max="1" step="0.01" value="-0.08" required></label><label>How much jumps vary · log units<input name="jumpStd" type="number" min="0" max="1" step="0.01" value="0.1" required></label><label>How many price steps ahead?<input name="horizon" type="number" min="1" max="252" step="1" value="21" required></label><label>Drop cutoff · log units<input name="threshold" type="number" min="-2" max="2" step="0.01" value="-0.02" required></label><button class="primary">Show this pretend world</button><p class="hint">This pretend year has 252 equal price steps. For the log inputs, −0.02 is about a 1.98% drop and −0.08 is about a 7.69% drop. The growth setting includes the jumps. Over one year the average price change is exp(growth setting) − 1; 0.06 gives about 6.18%.</p></form><div><div id="jump-status" role="status" aria-live="polite"></div><div class="stats" id="jump-stats"></div><div class="charts"><section class="plot"><h3>Where might the price change land?</h3><p>Taller parts show where changes cluster. The area under a part of the curve gives its chance. Technical name: probability density (PDF).</p><div id="jump-pdf" class="chart"></div></section><section class="plot"><h3>What is the chance of this change or less?</h3><p>Read the blue curve for the world with jumps. Gray is a smooth bell-shaped comparison with the same mean and variance. Technical name: cumulative probability (CDF).</p><div id="jump-cdf" class="chart"></div></section></div><details><summary>Rules and calculation checks</summary><pre id="jump-audit"></pre></details></div></div></section><section id="methods" class="view prose" hidden><h2>A quick guide.</h2><p>QuantLab is a learning tool. It makes uncertain guesses about the next price, then checks earlier guesses against answers.</p><h3>Try it in three steps</h3><ol><li>Open <b>Price explorer</b>. Keep <b>Made-up prices</b> selected.</li><li>Press <b>Show my guess</b>. The three numbers show the chances of all three outcomes.</li><li>Read <b>Did the guesses help?</b> A clever method is only useful if it beats a simple comparison.</li></ol><h3>What do the words mean?</h3><p><b>Chance:</b> how often something might happen in many similar situations. A 20% chance means about 20 out of 100, not a promise about one outcome.</p><p><b>Guessing method:</b> a set of rules that learns from earlier prices. Researchers call it a model.</p><p><b>Practice and check:</b> learn from earlier answers, then check on later answers that were kept apart. Looking at the check answers again and again can still make the test unfair.</p><p><b>Made-up prices:</b> a repeatable example, not real market data. Doing well on it does not show that a method works in real markets.</p><h3>Find your way around</h3><p><b>Price explorer</b> makes the three guesses. <b>Number games</b> has separate calculators, including a pretend trading-cost story. <b>What if?</b> lets you invent a world with surprise price jumps. The arrows beside extra details open them when you want to learn more.</p><h3>Your file stays in this browser</h3><p>Your CSV is read here and is not sent to a modeling server. A few recent calculations are kept temporarily in this tab. Use <b>Clear my results</b> or reload to remove the app’s saved data. The browser controls when memory is actually reclaimed.</p><p>These guesses can be wrong. They are not instructions to buy, sell or place a bet. This app has not shown that its guesses can make money.</p><details><summary>More detail · methods, privacy and limits</summary><h3>Data cleaning & privacy</h3><p>CSV parsing is bounded to 2 MiB, 2,500 price rows, 64 columns and 16,384 characters per field. We normalize header case, trim surrounding date/price whitespace and accept an initial byte-order mark. Every change is counted in the report. Duplicate dates, missing values and invalid prices are rejected with row numbers. Large moves, unchanged prices and calendar gaps are flagged and retained. We cannot verify whether prices are adjusted from two columns alone.</p><h3>Temporary caching</h3><p>Identical validated dates, prices, validation approach and model revision can reuse one of up to three fitted runs in this tab for ten minutes from computation. Cache hits are labeled. No uploaded prices or reports are written to localStorage, IndexedDB or a service-worker cache. Reloading or Clear my results removes application-held data; browser and operating-system memory reclamation is outside the app’s control. Public app assets may be cached by your browser or Hugging Face. The saved Python benchmark is fetched with revalidation.</p><h3>Validation contract</h3><p>At close t, returns, momentum, realized volatility and drawdown use only observations through t. Strict mode fits at least 500 training rows, temperatures on 150 later rows, and model choice on another 150 rows. A one-row embargo separates each boundary, followed by a reserved final 200-outcome evaluation. The coefficients, temperatures and model choice remain frozen for the latest forecast; features and EWMA state advance causally. Classic mode uses expanding training, a shared 150-row calibration/selection block and test blocks of up to 200. Repeatedly inspecting a reserved evaluation can still overfit it. This is not a permanently sealed holdout. Never tune using the test charts.</p><p>The target is the next observed close’s log return. Downside is below −0.02 log return, approximately −1.98% simple return; the middle event includes both boundaries, and the final event is a positive return. Probabilities sum to one.</p><h3>EWMA challenger</h3><p>The ridge mean stays frozen within each fold. Residual variance updates online with a fixed 20-observation half-life, using only outcomes already known before each forecast. Its own target never updates its own variance. The audit records volatility and timing; annualization assumes 252 equal-length observations and is only illustrative for gapped CSVs.</p><h3>Two distinct execution modes</h3><p><b>Browser experiment:</b> empirical frequencies, ridge with Gaussian residual probabilities, EWMA residual-volatility probabilities, and multinomial logistic regression are fitted to the selected data. Synthetic JavaScript draws differ from Python even with the same seed.</p><p><b>Precomputed Python benchmark:</b> a saved 900-observation synthetic run actually fitted scikit-learn, XGBoost and LightGBM, completed three training-only Optuna trials, computed SHAP and recorded MLflow metrics. Loading it does not execute those libraries. Download the full Python/Gradio project to run them locally.</p><h3>When the learning examples may not be enough</h3><p>A note appears when an outcome has fewer than 10 training examples, or when recent price patterns are unusual compared with training. These are simple checks, not a guarantee of reliability. The absence of a note does not prove a guess is safe or accurate.</p><p><a href="MODEL-STUDY.md">Latest model tests and rejected changes</a></p><h3>Implementation limits</h3><p>Classic calibration reuses data for temperatures and model choice. Strict mode separates these stages but cannot prevent repeated human inspection. Financial tails and nonstationarity can invalidate normal residual assumptions. Tiny test samples and sparse reliability bins are especially unreliable. The validation panel shows matched untuned and calibrated empirical baselines, fold populations, support warnings and descriptive paired uncertainty. It shows rolling loss, Brier score, entropy and event counts; it does not implement feature-drift testing or an automatic fallback strategy. The saved Python benchmark predates this panel and does not have row-matched baseline probabilities, so its new comparisons remain unavailable. SHAP explains uncalibrated raw class margins, not causal effects. Close-based information does not imply executable same-close fills. The separate trading-cost story uses chosen assumptions; it is not an economic backtest. No live trading is included.</p><p>TFT, DeepSurv, PPO, calibrated rough-volatility models, SPDE solvers and quantum algorithms remain unimplemented. Qiskit has no defined task here; TensorFlow would duplicate the optional PyTorch backend. The downloadable project records all requested books and access limits; full books were not read.</p><p>The implied-volatility solver and jump-mixture PDF/CDF explorer are independently implemented standard methods inspired by <a href="https://github.com/quantmind/quantflow">Quantflow</a>. No upstream source is copied and the Python package is not installed in this static host.</p><p><a href="METHODS.md">Detailed method & provenance notes</a> · <a href="CACHING.md">Caching design</a> · <a href="SECURITY-REVIEW.md">Data & cache security review</a> · <a href="python-project.zip" download>Full Python source and tests</a></p></details></section></main><footer><span>QuantLab · explore, ask, check.</span><span>Runs in your browser · free to use</span></footer></body></html>2 unmodified lines3456789101155 unmodified lines676869707172732 unmodified lines<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#f5f5f7"><meta name="description" content="Explore price possibilities with simple examples and clear checks. Runs in your browser."><meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; worker-src 'self'; connect-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'none'; form-action 'none'"><title>QuantLab · probability research</title><link rel="stylesheet" href="style.css?v=20261027audit1"><script src="labs.js?v=20261027audit1" defer></script><script src="cache.js?v=20261027audit1" defer></script><script src="scenarios.js" defer></script><script src="provenance.js?v=20261026provenance1" defer></script><script src="forward.js?v=20261027audit1" defer></script><script src="execution.js?v=20261027audit1" defer></script><script src="app.js?v=20261027audit1" defer></script></head><body><a class="skip" href="#results">Skip to results</a>55 unmodified lines<p id="cost-threshold" class="cost-threshold" aria-live="polite"></p><div id="cost-output" class="calculation-result" role="status" aria-live="polite"></div><details><summary>How this story works</summary><p class="hint">Each trade uses the same starting amount. Every finished trade buys and sells once, with the same price change and costs. Unfinished trades are assumed never to fill, so they cost nothing here. All percentages are applied to the starting amount; money is not reinvested. Skipping a losing trade can help. Real orders can fill only partly, and their timing and price can differ.</p><p class="hint">This is arithmetic, not a historical trading test, order-book replay or estimate of future profit. HftBacktest, NautilusTrader and KalshiMarketMaker are not running here.</p><pre id="cost-audit"></pre></details></section></section><section id="distributions" class="view" hidden><h2>What if prices took surprise jumps?</h2><p class="scenario-note">Make a pretend world: prices wiggle and sometimes jump. You choose all the settings. This does not learn from your price file or predict real markets.</p><div class="scenario-layout"><form id="jump-form"><h3>Build a pretend year</h3><label>Yearly growth setting · 0.06 is about 6%<input name="mu" type="number" min="-1" max="1" step="0.01" value="0.06" required></label><label>Yearly wiggle size · 0.20 means 20%<input name="sigma" type="number" min="0.01" max="2" step="0.01" value="0.2" required></label><label>Average surprise jumps per year<input name="intensity" type="number" min="0" max="50" step="0.5" value="2" required></label><label>Average jump · log units<input name="jumpMean" type="number" min="-1" max="1" step="0.01" value="-0.08" required></label><label>How much jumps vary · log units<input name="jumpStd" type="number" min="0" max="1" step="0.01" value="0.1" required></label><label>How many price steps ahead?<input name="horizon" type="number" min="1" max="252" step="1" value="21" required></label><label>Drop cutoff · log units<input name="threshold" type="number" min="-2" max="2" step="0.01" value="-0.02" required></label><button class="primary">Show this pretend world</button><p class="hint">This pretend year has 252 equal price steps. For the log inputs, −0.02 is about a 1.98% drop and −0.08 is about a 7.69% drop. The growth setting includes the jumps. Over one year the average price change is exp(growth setting) − 1; 0.06 gives about 6.18%.</p></form><div><div id="jump-status" role="status" aria-live="polite"></div><div class="stats" id="jump-stats"></div><div class="charts"><section class="plot"><h3>Where might the price change land?</h3><p>Taller parts show where changes cluster. The area under a part of the curve gives its chance. Technical name: probability density (PDF).</p><div id="jump-pdf" class="chart"></div></section><section class="plot"><h3>What is the chance of this change or less?</h3><p>Read the blue curve for the world with jumps. Gray is a smooth bell-shaped comparison with the same mean and variance. Technical name: cumulative probability (CDF).</p><div id="jump-cdf" class="chart"></div></section></div><details><summary>Rules and calculation checks</summary><pre id="jump-audit"></pre></details></div></div></section><section id="methods" class="view prose" hidden><h2>A quick guide.</h2><p>QuantLab is a learning tool. It makes uncertain guesses about the next price, then checks earlier guesses against answers.</p><h3>Try it in three steps</h3><ol><li>Open <b>Price explorer</b>. Keep <b>Made-up prices</b> selected.</li><li>Press <b>Show my guess</b>. The three numbers show the chances of all three outcomes.</li><li>Read <b>Did the guesses help?</b> A clever method is only useful if it beats a simple comparison.</li></ol><h3>What do the words mean?</h3><p><b>Chance:</b> how often something might happen in many similar situations. A 20% chance means about 20 out of 100, not a promise about one outcome.</p><p><b>Guessing method:</b> a set of rules that learns from earlier prices. Researchers call it a model.</p><p><b>Practice and check:</b> learn from earlier answers, then check on later answers that were kept apart. Looking at the check answers again and again can still make the test unfair.</p><p><b>Made-up prices:</b> a repeatable example, not real market data. Doing well on it does not show that a method works in real markets.</p><h3>Find your way around</h3><p><b>Price explorer</b> makes the three guesses. <b>Number games</b> has separate calculators, including a pretend trading-cost story. <b>What if?</b> lets you invent a world with surprise price jumps. The arrows beside extra details open them when you want to learn more.</p><h3>Your file stays in this browser</h3><p>Your CSV is read here and is not sent to a modeling server. A few recent calculations are kept temporarily in this tab. Use <b>Clear my results</b> or reload to remove the app’s saved data. The browser controls when memory is actually reclaimed.</p><p>These guesses can be wrong. They are not instructions to buy, sell or place a bet. This app has not shown that its guesses can make money.</p><details><summary>More detail · methods, privacy and limits</summary><h3>Data cleaning & privacy</h3><p>CSV parsing is bounded to 2 MiB, 2,500 price rows, 64 columns and 16,384 characters per field. We normalize header case, trim surrounding date/price whitespace and accept an initial byte-order mark. Every change is counted in the report. Duplicate dates, missing values and invalid prices are rejected with row numbers. Large moves, unchanged prices and calendar gaps are flagged and retained. We cannot verify whether prices are adjusted from two columns alone.</p><h3>Temporary caching</h3><p>Identical validated dates, prices, validation approach and model revision can reuse one of up to three fitted runs in this tab for ten minutes from computation. Cache hits are labeled. No uploaded prices or reports are written to localStorage, IndexedDB or a service-worker cache. Reloading or Clear my results removes application-held data; browser and operating-system memory reclamation is outside the app’s control. Public app assets may be cached by your browser or Hugging Face. The saved Python benchmark is fetched with revalidation.</p><h3>Validation contract</h3><p>At close t, returns, momentum, realized volatility and drawdown use only observations through t. Strict mode fits at least 500 training rows, temperatures on 150 later rows, and model choice on another 150 rows. A one-row embargo separates each boundary, followed by a reserved final 200-outcome evaluation. The coefficients, temperatures and model choice remain frozen for the latest forecast; features and EWMA state advance causally. Classic mode uses expanding training, a shared 150-row calibration/selection block and test blocks of up to 200. Repeatedly inspecting a reserved evaluation can still overfit it. This is not a permanently sealed holdout. Never tune using the test charts. Strict mode also lets unadjusted past-outcome counts compete during selection, with no temperature fitted for that candidate.</p><p>The target is the next observed close’s log return. Downside is below −0.02 log return, approximately −1.98% simple return; the middle event includes both boundaries, and the final event is a positive return. Probabilities sum to one.</p><h3>EWMA challenger</h3><p>The ridge mean stays frozen within each fold. Residual variance updates online with a fixed 20-observation half-life, using only outcomes already known before each forecast. Its own target never updates its own variance. The audit records volatility and timing; annualization assumes 252 equal-length observations and is only illustrative for gapped CSVs.</p><h3>Two distinct execution modes</h3><p><b>Browser experiment:</b> empirical frequencies (untuned and temperature-adjusted in strict mode), ridge with Gaussian residual probabilities, EWMA residual-volatility probabilities, and multinomial logistic regression are fitted to the selected data. Synthetic JavaScript draws differ from Python even with the same seed.</p><p><b>Precomputed Python benchmark:</b> a saved 900-observation synthetic run actually fitted scikit-learn, XGBoost and LightGBM, completed three training-only Optuna trials, computed SHAP and recorded MLflow metrics. Loading it does not execute those libraries. Download the full Python/Gradio project to run them locally.</p><h3>When the learning examples may not be enough</h3><p>A note appears when an outcome has fewer than 10 training examples, or when recent price patterns are unusual compared with training. These are simple checks, not a guarantee of reliability. The absence of a note does not prove a guess is safe or accurate.</p><p><a href="MODEL-STUDY.md">Model tests and rejected changes</a> · <a href="LEAK-AUDIT.md">Data leakage and overfitting checks</a></p><h3>Implementation limits</h3><p>Classic calibration reuses data for temperatures and model choice. Strict mode separates these stages but cannot prevent repeated human inspection. Financial tails and nonstationarity can invalidate normal residual assumptions. Tiny test samples and sparse reliability bins are especially unreliable. The validation panel shows matched untuned and calibrated empirical baselines, fold populations, support warnings and descriptive paired uncertainty. It shows rolling loss, Brier score, entropy and event counts; it does not implement feature-drift testing or an automatic fallback strategy. The saved Python benchmark predates this panel and does not have row-matched baseline probabilities, so its new comparisons remain unavailable. SHAP explains uncalibrated raw class margins, not causal effects. Close-based information does not imply executable same-close fills. The separate trading-cost story uses chosen assumptions; it is not an economic backtest. No live trading is included.</p><p>TFT, DeepSurv, PPO, calibrated rough-volatility models, SPDE solvers and quantum algorithms remain unimplemented. Qiskit has no defined task here; TensorFlow would duplicate the optional PyTorch backend. The downloadable project records all requested books and access limits; full books were not read.</p><p>The implied-volatility solver and jump-mixture PDF/CDF explorer are independently implemented standard methods inspired by <a href="https://github.com/quantmind/quantflow">Quantflow</a>. No upstream source is copied and the Python package is not installed in this static host.</p><p><a href="METHODS.md">Detailed method & provenance notes</a> · <a href="CACHING.md">Caching design</a> · <a href="SECURITY-REVIEW.md">Data & cache security review</a> · <a href="python-project.zip" download>Full Python source and tests</a></p></details></section></main><footer><span>QuantLab · explore, ask, check.</span><span>Runs in your browser · free to use</span></footer></body></html>
123version https://git-lfs.github.com/spec/v1oid sha256:f3aa743975bdd1947dfa6ebdbac474812f897703c5d4307b05744e10071c2047size 2657528 unmodified lines29303132333435363738395 unmodified lines4546474849505128 unmodified linesfor(let iter=0;iter<100;iter++){const grad=Array.from({length:p+1},()=>[0,0,0]);for(let i=0;i<n;i++){const logits=[0,0,0];for(let j=0;j<=p;j++)for(let k=0;k<3;k++)logits[k]+=z[i][j]*weights[j][k];const prob=softmax(logits);for(let j=0;j<=p;j++)for(let k=0;k<3;k++)grad[j][k]+=z[i][j]*(prob[k]-(cls(y[i])===k?1:0))/n;}for(let j=0;j<=p;j++)for(let k=0;k<3;k++)weights[j][k]-=step*(grad[j][k]+(j?.03*weights[j][k]:0));}return{m,scale,beta,sigma,training_residual_mse:mean(residual.map(v=>v*v)),weights,empirical:counts.map(v=>v/(n+3))};}function ridgeMean(model,x){return model.beta[0]+x.reduce((sum,v,j)=>sum+(v-model.m[j])/model.scale[j]*model.beta[j+1],0);}function probabilities(model,x,name,sigmaOverride){if(name==='empirical')return model.empirical.slice();const z=[1,...x.map((v,j)=>(v-model.m[j])/model.scale[j])];if(name==='softmax'){const v=[0,0,0];for(let j=0;j<z.length;j++)for(let k=0;k<3;k++)v[k]+=z[j]*model.weights[j][k];return softmax(v);}const mu=z.reduce((s,v,j)=>s+v*model.beta[j],0),sigma=sigmaOverride??model.sigma,lo=cdf((-.02-mu)/sigma),hi=cdf(-mu/sigma);return[lo,Math.max(0,hi-lo),1-hi];}function run(close,{protocol='classic'}={}){if(!['classic','strict'].includes(protocol))throw Error('Unknown validation protocol');const strict=protocol==='strict';validate(close,strict?1064:714);if(close.length>2500)throw Error('Maximum 2500 closes');const{x,y,indices}=features(close),names=['empirical','ridge','softmax','ewma'],predictions=[],folds=[],allQ={empirical:[],ridge:[],softmax:[],ewma:[]},allY=[],selectedQ=[],rawQ=[];const counts=(start,stop)=>{const n=[0,0,0];for(const v of y.slice(start,stop))n[cls(v)]++;return n;};function train(calStop,separate=false){const calStart=calStop-150,tempStop=separate?calStart-1:calStop,tempStart=separate?tempStop-150:calStart,trainStop=tempStart-1;5 unmodified linesif(i<y.length){const residual=y[i]-ridgeMean(model,x[i]);variance=(1-alpha)*variance+alpha*residual*residual;}}const qFor=(name,start,stop)=>x.slice(start,stop).map((row,j)=>probabilities(model,row,name,name==='ewma'?ewmaSigmas[start+j]:undefined));for(const name of names){const q=qFor(name,tempStart,tempStop);let best=Infinity;for(const t of [.5,.75,1,1.5,2,3]){const score=metrics(y.slice(tempStart,tempStop),q.map(p=>temperature(p,t))).log_loss;if(score<best){best=score;temps[name]=t;}}scores[name]=metrics(y.slice(calStart,calStop),qFor(name,calStart,calStop).map(p=>temperature(p,temps[name]))).log_loss;}const chosen=names.reduce((a,b)=>scores[a]<=scores[b]?a:b);return{model,temps,scores,chosen,calStart,calStop,tempStart,tempStop,trainStop,ewmaSigmas};}28 unmodified lines29303132333435363738395 unmodified lines4546474849505128 unmodified linesfor(let iter=0;iter<100;iter++){const grad=Array.from({length:p+1},()=>[0,0,0]);for(let i=0;i<n;i++){const logits=[0,0,0];for(let j=0;j<=p;j++)for(let k=0;k<3;k++)logits[k]+=z[i][j]*weights[j][k];const prob=softmax(logits);for(let j=0;j<=p;j++)for(let k=0;k<3;k++)grad[j][k]+=z[i][j]*(prob[k]-(cls(y[i])===k?1:0))/n;}for(let j=0;j<=p;j++)for(let k=0;k<3;k++)weights[j][k]-=step*(grad[j][k]+(j?.03*weights[j][k]:0));}return{m,scale,beta,sigma,training_residual_mse:mean(residual.map(v=>v*v)),weights,empirical:counts.map(v=>v/(n+3))};}function ridgeMean(model,x){return model.beta[0]+x.reduce((sum,v,j)=>sum+(v-model.m[j])/model.scale[j]*model.beta[j+1],0);}function probabilities(model,x,name,sigmaOverride){if((name==='empirical'||name==='empirical_raw'))return model.empirical.slice();const z=[1,...x.map((v,j)=>(v-model.m[j])/model.scale[j])];if(name==='softmax'){const v=[0,0,0];for(let j=0;j<z.length;j++)for(let k=0;k<3;k++)v[k]+=z[j]*model.weights[j][k];return softmax(v);}const mu=z.reduce((s,v,j)=>s+v*model.beta[j],0),sigma=sigmaOverride??model.sigma,lo=cdf((-.02-mu)/sigma),hi=cdf(-mu/sigma);return[lo,Math.max(0,hi-lo),1-hi];}function run(close,{protocol='classic'}={}){if(!['classic','strict'].includes(protocol))throw Error('Unknown validation protocol');const strict=protocol==='strict';validate(close,strict?1064:714);if(close.length>2500)throw Error('Maximum 2500 closes');const{x,y,indices}=features(close),names=strict?['empirical','ridge','softmax','ewma','empirical_raw']:['empirical','ridge','softmax','ewma'],predictions=[],folds=[],allQ=Object.fromEntries(names.map(name=>[name,[]])),allY=[],selectedQ=[],rawQ=[];const counts=(start,stop)=>{const n=[0,0,0];for(const v of y.slice(start,stop))n[cls(v)]++;return n;};function train(calStop,separate=false){const calStart=calStop-150,tempStop=separate?calStart-1:calStop,tempStart=separate?tempStop-150:calStart,trainStop=tempStart-1;5 unmodified linesif(i<y.length){const residual=y[i]-ridgeMean(model,x[i]);variance=(1-alpha)*variance+alpha*residual*residual;}}const qFor=(name,start,stop)=>x.slice(start,stop).map((row,j)=>probabilities(model,row,name,name==='ewma'?ewmaSigmas[start+j]:undefined));for(const name of names){const q=qFor(name,tempStart,tempStop);let best=Infinity;for(const t of (name==='empirical_raw'?[1]:[.5,.75,1,1.5,2,3])){const score=metrics(y.slice(tempStart,tempStop),q.map(p=>temperature(p,t))).log_loss;if(score<best){best=score;temps[name]=t;}}scores[name]=metrics(y.slice(calStart,calStop),qFor(name,calStart,calStop).map(p=>temperature(p,temps[name]))).log_loss;}const chosen=names.reduce((a,b)=>scores[a]<=scores[b]?a:b);return{model,temps,scores,chosen,calStart,calStop,tempStart,tempStop,trainStop,ewmaSigmas};}
123456789101112'use strict';const assert=require('node:assert/strict'),fs=require('node:fs');const html=fs.readFileSync(require.resolve('./index.html'),'utf8');const policy=html.match(/<meta\s+http-equiv="Content-Security-Policy"\s+content="([^"]+)"/i)?.[1];assert(policy,'An explicit page security policy is required');const directives=new Map(policy.split(';').map(s=>s.trim().split(/\s+/)).filter(a=>a[0]).map(([k,...v])=>[k,v]));assert.deepEqual(directives.get('form-action'),["'none'"],'Native fallback submissions must be blocked even if JavaScript fails');assert.deepEqual(directives.get('connect-src'),["'self'"]);assert.deepEqual(directives.get('script-src'),["'self'"]);assert.deepEqual(directives.get('object-src'),["'none'"]);assert(!/<form\b[^>]*\baction\s*=\s*["']https?:/i.test(html),'Local calculators must not submit to remote endpoints');console.log('Privacy policy tests passed: fail-closed native form submission, same-origin connections/scripts and no object plugins');29 unmodified lines30313229 unmodified linesassert.throws(()=>Q.run(Q.synthetic(1063,7),{protocol:'strict'}));assert.throws(()=>Q.run(close,{protocol:'unknown'}));console.log('validation model passed: strict split, frozen fit, baseline/fold audits, minimum history');29 unmodified lines3031323334353637383940414229 unmodified linesassert.throws(()=>Q.run(Q.synthetic(1063,7),{protocol:'strict'}));assert.throws(()=>Q.run(close,{protocol:'unknown'}));console.log('validation model passed: strict split, frozen fit, baseline/fold audits, minimum history');assert(strict.candidate_metrics.empirical_raw,'Strict choice must include untuned frequency');assert.equal(fold.temperatures.empirical_raw,1,'Raw baseline must never fit a temperature');const raw=fold.training_class_counts.map(c=>(c+1)/(fold.fit_metadata.training_observations+3));const ys=Q.features(close).y.slice(fold.selection_feature_start-60,fold.selection_feature_end-60+1);const loss=ys.reduce((sum,y)=>sum-Math.log(raw[y<-.02?0:y>0?2:1]),0)/ys.length;assert(Math.abs(loss-fold.calibration_log_loss.empirical_raw)<1e-12,'Choice score must use selection labels only');assert.equal(fold.calibration_log_loss[fold.selected],Math.min(...Object.values(fold.calibration_log_loss)));assert(!Q.run(close).candidate_metrics.empirical_raw,'Classic numerical policy remains unchanged');console.log('Untuned strict candidate passed: fixed temperature, independent selection score and unchanged classic candidate set');
1234567const assert=require('node:assert/strict'),vm=require('node:vm'),fs=require('node:fs');const Q=require('./model.js'),labs=require('./labs.js'),validation=require('./validation.js');const messages=[],loaded=[];const context={QuantModel:Q,QuantLabs:labs,QuantValidation:validation,self:{postMessage:value=>messages.push(value)},importScripts:(...names)=>{for(const name of names){assert.match(name,/^(model|labs|validation)\.js\?v=20261027support1$/);loaded.push(name);}}};vm.runInNewContext(fs.readFileSync(require.resolve('./worker.js'),'utf8'),context);assert.equal(loaded.length,3);for(const protocol of ['strict','classic']){1234567const assert=require('node:assert/strict'),vm=require('node:vm'),fs=require('node:fs');const Q=require('./model.js'),labs=require('./labs.js'),validation=require('./validation.js');const messages=[],loaded=[];const context={QuantModel:Q,QuantLabs:labs,QuantValidation:validation,self:{postMessage:value=>messages.push(value)},importScripts:(...names)=>{for(const name of names){assert.match(name,/^(model|labs|validation)\.js\?v=20261027audit1$/);loaded.push(name);}}};vm.runInNewContext(fs.readFileSync(require.resolve('./worker.js'),'utf8'),context);assert.equal(loaded.length,3);for(const protocol of ['strict','classic']){
12345'use strict';importScripts('model.js?v=20261027support1','labs.js?v=20261027support1','validation.js?v=20261027support1');self.onmessage=event=>{try { const closes=event.data.closes; const report=QuantModel.run(closes,{protocol:event.data.protocol||'classic'});report.validation=QuantValidation.analyze(report);self.postMessage({report,diagnostics:QuantLabs.diagnostics(closes)}); }catch(error){self.postMessage({error:error.message});}12345'use strict';importScripts('model.js?v=20261027audit1','labs.js?v=20261027audit1','validation.js?v=20261027audit1');self.onmessage=event=>{try { const closes=event.data.closes; const report=QuantModel.run(closes,{protocol:event.data.protocol||'classic'});report.validation=QuantValidation.analyze(report);self.postMessage({report,diagnostics:QuantLabs.diagnostics(closes)}); }catch(error){self.postMessage({error:error.message});}
LEAK-AUDIT.mdAdded+16
METHODS.md+3
MODEL-STUDY.md+3
README.md+2
SECURITY-REVIEW.md+3
VERIFICATION.md+3
app.js+3-3
index.html+4-4
leakage-audit.zipAdded+3
model.js+3-3
test_privacy_policy.cjsAdded+12
test_validation_model.cjs+10
test_worker.cjs+1-1
worker.js+1-1