@davoodmehraban89 / VELYQOR / commits / d2d100d
Fork 0

Intelligence, Advanced Charting & Trading Platform

security(risk): block persistent alert state unless explicit storage and alert licensing are verified

davoodmehraban89 committed Oct 22, 2026 at 23:41 UTC d2d100da198cb98de6631ddc12194758d887c21e
1 file changed +6
packages/market-domain/src/alert-postgres-coordinator.mjs
+6
@@ -61,6 +61,12 @@ function validateArgs({db,domain,principal,rule,recipient,observation,now}){
61 observation.symbol!==rule.symbol||observation.provider!==rule.provider||
62 observation.unit!==rule.unit||observation.side!==rule.legs[0].side)
63 throw new TypeError('observation must match trusted source, unit and exit side');
64 + // The persisted gate/high-water state contains historical provider prices.
65 + // A display/alert license alone is NOT a right to store this state in Neon.
66 + if(observation.permission?.publicDisplay!==true||
67 + observation.permission?.derivedAlerts!==true||
68 + observation.permission?.historicalStorage!==true)
69 + throw new Error('PRICE_STORAGE_OR_ALERT_RIGHTS_UNVERIFIED');
70 if(typeof now!=='string'||!Number.isFinite(Date.parse(now)))
71 throw new TypeError('valid server time required');
72 }