@davoodmehraban89 / Factor-easy / commits / dfa379e
Fork 0

سامانه صدور فاکتور و حسابداری

Add failing Office C3 invariant coverage

davoodmehraban89 committed Sep 30, 2026 at 19:15 UTC dfa379e6b874bcb3132dce9574338a8a26afbcb0
1 file changed +20
scripts/office-slice-c3-check.mjs new
+20
@@ -0,0 +1,20 @@
1 +import fs from 'node:fs';
2 +import path from 'node:path';
3 +const need=(t,r,l)=>{if(!r.test(t))throw new Error('Office C3 invariant missing: '+l)};
4 +const dir=path.join(process.cwd(),'supabase','migrations');
5 +const file=fs.readdirSync(dir).find(x=>/office_slice_c3_related_archive\.sql$/.test(x));
6 +if(!file)throw new Error('Office C3 invariant missing: archived production migration');
7 +const m=fs.readFileSync(path.join(dir,file),'utf8');
8 +need(m,/office_link_correspondence/i,'relation RPC');
9 +need(m,/relation_created/i,'append-only relation evidence');
10 +need(m,/reply_to/i,'reply relation');
11 +need(m,/reply cycle/i,'reply cycle denial');
12 +need(m,/office_classify_correspondence/i,'classification RPC');
13 +need(m,/archive_classified/i,'classification evidence');
14 +need(m,/office_archive_search/i,'server archive search');
15 +need(m,/private\.can_access_record/i,'record-level archive authorization');
16 +const ui=fs.readFileSync('js/office-mature.js','utf8');
17 +need(ui,/officeLoadArchiveIndex/i,'archive index loader');
18 +need(ui,/officeClassifyPrompt/i,'classification UI');
19 +need(ui,/officeLinkPrompt/i,'relation UI');
20 +console.log('Office Slice C3 server + runtime contract: PASS');