سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 19:30 UTC
Add failing Office C6 invariant coverage
davoodmehraban89 committed
Oct 1, 2026 at 00:12 UTC
7988e0b9e7a71b294e12dc6d03f9cd6faaa11274
1 file changed
+17
scripts/office-slice-c6-check.mjs
new
+17
@@ -0,0 +1,17 @@
1
+import fs from 'node:fs';import path from 'node:path';
2
+const need=(t,r,l)=>{if(!r.test(t))throw new Error('Office C6 invariant missing: '+l)};
3
+const dir=path.join(process.cwd(),'supabase','migrations');
4
+const files=fs.readdirSync(dir).filter(x=>/office_slice_c6_.*\.sql$/.test(x));
5
+if(!files.length)throw new Error('Office C6 invariant missing: SLA migration');
6
+const m=files.map(x=>fs.readFileSync(path.join(dir,x),'utf8')).join('\n');
7
+need(m,/office_emit_sla_event/i,'SLA event RPC');
8
+need(m,/sla_reminder/i,'reminder evidence');
9
+need(m,/sla_escalated/i,'escalation evidence');
10
+need(m,/policyWindow/i,'deduplication policy window');
11
+need(m,/pending work required/i,'terminal-work rejection');
12
+need(m,/office_sla_work_queue/i,'server SLA queue');
13
+need(m,/external.*delivery|no external/i,'external delivery boundary');
14
+const ui=fs.readFileSync('js/office-mature.js','utf8');
15
+need(ui,/officeLoadSlaQueue/i,'SLA queue loader');
16
+need(ui,/officeEmitSlaEvent/i,'SLA action UI');
17
+console.log('Office Slice C6 SLA contract: PASS');