سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 08:00 UTC
ci(phase1a): enforce exact non-function catalog equality and lexical-equivalent 154 function bodies
davoodmehraban89 committed
Oct 16, 2026 at 14:15 UTC
dc0dd5de8c622a4223ca08103ffa79f816ca9e73
1 file changed
+21
-4
.github/workflows/phase1a-supabase-parity.yml
+21
-4
@@ -68,6 +68,11 @@ jobs:
68
else
69
echo 'class_ok=false' >> "$GITHUB_OUTPUT"
70
fi
71
+ - name: Token-by-token function comparison preserving quoted SQL literals
72
+ id: function_token_parity
73
+ run: |
74
+ PGPASSWORD=postgres psql -h 127.0.0.1 -p 54322 -U postgres -d postgres -X -qAt -v ON_ERROR_STOP=1 -f supabase/tests/phase1a_function_sources.sql > phase1a-local-function-sources.json
75
+ node scripts/phase1a-lexical-compare.mjs supabase/tests/fixtures/phase1a_production_lexical_tokens_20261016.json phase1a-local-function-sources.json
76
- name: Apply 1A-only migrations on disposable Supabase CLI database
77
run: |
78
PGPASSWORD=postgres psql -h 127.0.0.1 -p 54322 -U postgres -d postgres -X -v ON_ERROR_STOP=1 -f /tmp/finora-phase1a-migrations/20261016100000_phase1a_server_journal_invariants.sql
@@ -82,11 +87,22 @@ jobs:
87
run: PGPASSWORD=postgres psql -h 127.0.0.1 -p 54322 -U postgres -d postgres -X -v ON_ERROR_STOP=1 -f supabase/tests/phase1a_10000_voucher_index_benchmark.sql
88
- name: Validate client JavaScript syntax
89
run: node --check js/sync.js
85
- - name: Require exact baseline schema parity for 1A acceptance
86
- if: ${{ steps.baseline_parity.outputs.matched != 'true' }}
90
+ - name: Require baseline schema parity modulo lexical-equivalent function formatting
91
run: |
88
- echo '::error::Baseline schema fingerprints still differ; Phase 1A acceptance blocked. See artifact.'
89
- exit 1
92
+ node --input-type=module -e "
93
+ import fs from 'node:fs';
94
+ const a=JSON.parse(fs.readFileSync('phase1a-schema-diff.json'));
95
+ const b=JSON.parse(fs.readFileSync('phase1a-lexical-diff.json'));
96
+ const c=JSON.parse(fs.readFileSync('phase1a-function-classification.json'));
97
+ const nonFunctions=a.D_sameIdentityDifferentDefinition.filter(x=>!x.startsWith('function|'));
98
+ if(a.B_productionOnly.length || a.C_repositoryOnly.length || nonFunctions.length ||
99
+ b.bodyMismatch.length || b.productionOnly.length || b.localOnly.length ||
100
+ c.findings.metadataChanged.length) {
101
+ console.error('SCHEMA_PARITY_FAIL: unreviewed material schema drift');
102
+ process.exit(1);
103
+ }
104
+ console.log('SCHEMA_PARITY_PASS: 1069 baseline objects, 154 lexically identical function bodies and matching function metadata');
105
+ "
106
- name: Upload schema fingerprint diff (no private row data)
107
if: always()
108
uses: actions/upload-artifact@v4
@@ -96,5 +112,6 @@ jobs:
112
phase1a-schema-diff.json
113
phase1a-local-schema.json
114
phase1a-function-classification.json
115
+ phase1a-lexical-diff.json
116
retention-days: 7
117
if-no-files-found: ignore