From 077953976cd712401aabe8d8cc5876ef3f1888d6 Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 15 May 2026 13:43:53 +0200 Subject: [PATCH] Guard Soma timers contract --- src/uix/contracts.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/uix/contracts.test.ts b/src/uix/contracts.test.ts index 17e6c97ea..def703ad5 100644 --- a/src/uix/contracts.test.ts +++ b/src/uix/contracts.test.ts @@ -339,6 +339,18 @@ describe('UIX layer contracts', () => { expect(violations).toEqual([]); }); + it('guards Soma component timers through the injected scheduler', () => { + const allowedFallback = join(HERE, 'soma', 'components', 'announce', 'global.svelte.ts'); + const violations = listSourceFiles(join(HERE, 'soma', 'components')).filter((file) => { + if (file === allowedFallback) return false; + return /\bsetTimeout\(|\bclearTimeout\(|\bsetInterval\(|\bclearInterval\(/.test( + stripComments(readFileSync(file, 'utf8')) + ); + }); + + expect(violations).toEqual([]); + }); + it('guards hardcoded Soma component data attrs with morfo contracts', () => { const knownAttrs = collectKnownMorfoDataAttrs(); const violations = listSourceFiles(join(HERE, 'soma', 'components')).flatMap((file) => {