Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
Compare SHA-pinned original portable V6 Electron routing to rebuilt installer using bounded CDP route labels
davoodmehraban89 committed
Oct 18, 2026 at 06:45 UTC
1ae00067ab7c8a14623074d3bec3f0453aa41829
1 file changed
+93
.github/workflows/windows-v6-original-gui-route-probe-once.yml
new
+93
@@ -0,0 +1,93 @@
1
+name: V6 pinned original portable Electron routing probe (NOT V7)
2
+on:
3
+ push:
4
+ branches: ['ci/public-windows-bridge-probe-20261017']
5
+ paths: ['.github/workflows/windows-v6-original-gui-route-probe-once.yml']
6
+permissions:
7
+ contents: read
8
+jobs:
9
+ baseline:
10
+ runs-on: windows-2022
11
+ timeout-minutes: 18
12
+ defaults:
13
+ run:
14
+ shell: pwsh
15
+ env:
16
+ BANK_ADAPTER_MODE: disabled
17
+ TREASURYFLOW_ENABLE_MAYAN_EXTERNAL_READ: '0'
18
+ TREASURYFLOW_MAYAN_ENABLE_EXTERNAL_READ: '0'
19
+ TREASURYFLOW_ENABLE_SQL_LAB: '0'
20
+ TREASURYFLOW_DESKTOP_LOCAL: '1'
21
+ steps:
22
+ - name: Read-only private download and original V6 binary SHA pin
23
+ env:
24
+ GH_TOKEN: ${{ secrets.TF_VALIDATION_READ_TOKEN }}
25
+ run: |
26
+ $ErrorActionPreference='Stop'
27
+ if([string]::IsNullOrWhiteSpace($env:GH_TOKEN)){throw 'READ_ONLY_TOKEN_MISSING'}
28
+ $root=Join-Path $env:RUNNER_TEMP 'private-old-v6'
29
+ New-Item -Force -ItemType Directory -Path $root | Out-Null
30
+ gh release download validation-inputs-20261017 --repo davoodmehraban89/TreasuryFlow-Validation-Private --pattern release-native-v6-final.rar --dir $root 1>$null 2>$null
31
+ if($LASTEXITCODE -ne 0){throw 'RAR_FETCH_FAILED'}
32
+ $rar=Join-Path $root 'release-native-v6-final.rar'
33
+ if((Get-FileHash $rar -Algorithm SHA256).Hash -ine 'b8629defc172cef972ad12bb3a2e45a55abed3a5e3a5d991ab2567b877e0c915'){throw 'RAR_SHA_FAIL'}
34
+ & 7z.exe x -y "-o$root" $rar *> (Join-Path $env:RUNNER_TEMP 'private-extract.log')
35
+ if($LASTEXITCODE -ne 0){throw 'RAR_EXTRACT_FAILED'}
36
+ $x=@(Get-ChildItem $root -Recurse -File -Filter TreasuryFlow-1.0.1-Windows-x64.exe)
37
+ if($x.Count -ne 1){throw 'PINNED_EXE_NOT_UNIQUE'}
38
+ if((Get-FileHash $x[0].FullName -Algorithm SHA256).Hash -ine '99976331f606d8c8ffcf8e9f4895848ff736870790e14b4c7f08a0abdbb7a50a'){throw 'EXE_SHA_FAIL'}
39
+ "TF_ORIGINAL_EXE=$($x[0].FullName)" >> $env:GITHUB_ENV
40
+ Write-Host 'GATE_PASS_ORIGINAL_V6_BINARY_SHA256'
41
+ - name: Setup Node 22
42
+ uses: actions/setup-node@v4
43
+ with:
44
+ node-version: '22'
45
+ - name: Probe actual Electron CDP route groups without page content
46
+ run: |
47
+ $ErrorActionPreference='Continue'
48
+ $PSNativeCommandUseErrorActionPreference=$false
49
+ $probe=Join-Path $env:RUNNER_TEMP 'portable-v6-route-only.mjs'
50
+ @'
51
+ import {spawn,execFileSync} from 'node:child_process';
52
+ const exe=process.argv[2],base='http://127.0.0.1:3210',port=9571;
53
+ const flags={ready:false,bankDisabled:false,cdpTarget:false,navigationCommandSuccess:false,httpIntegrationsStatus:0,windowsProcessAlive:false,postNavTargetCount:0,postNavLocalTargetCount:0,initialGroup:'NONE',postGroups:[]};
54
+ const wait=ms=>new Promise(r=>setTimeout(r,ms));
55
+ function group(uri){try{const u=new URL(uri);if(u.origin!==base)return 'NON_LOCAL';if(u.pathname==='/')return 'ROOT';if(u.pathname.startsWith('/login'))return 'LOGIN';if(u.pathname.startsWith('/dashboard'))return 'DASHBOARD';if(u.pathname.startsWith('/integrations'))return 'INTEGRATIONS';return 'OTHER'}catch{return 'BAD_URL'}}
56
+ async function targets(){try{const r=await fetch('http://127.0.0.1:'+port+'/json/list',{signal:AbortSignal.timeout(1800)});return r.ok?r.json():[]}catch{return []}}
57
+ async function ready(){try{const r=await fetch(base+'/api/ready',{signal:AbortSignal.timeout(1600)});return r.ok?r.json():null}catch{return null}}
58
+ let app,ws;
59
+ try{
60
+ app=spawn(exe,['--remote-debugging-port='+port,'--remote-allow-origins=*'],{stdio:'ignore',windowsHide:false,env:{...process.env,BANK_ADAPTER_MODE:'disabled',TREASURYFLOW_DESKTOP_LOCAL:'1',TREASURYFLOW_ENABLE_MAYAN_EXTERNAL_READ:'0',TREASURYFLOW_ENABLE_SQL_LAB:'0'}});
61
+ let y;for(let i=0;i<75;i++){y=await ready();if(y?.status==='ready')break;await wait(600)}
62
+ flags.ready=y?.status==='ready';flags.bankDisabled=y?.bankAdapter==='disabled';
63
+ let list=[];for(let i=0;i<60;i++){list=await targets();if(list.some(x=>x.type==='page'&&x.webSocketDebuggerUrl))break;await wait(500)}
64
+ const target=list.find(x=>x.type==='page'&&x.webSocketDebuggerUrl);
65
+ flags.cdpTarget=!!target;flags.initialGroup=group(target?.url);
66
+ if(target){
67
+ ws=new WebSocket(target.webSocketDebuggerUrl);
68
+ await new Promise((resolve,reject)=>{const timeout=setTimeout(()=>reject(Error('WS_CONNECT_TIMEOUT')),8000);ws.addEventListener('open',()=>{clearTimeout(timeout);resolve()},{once:true});ws.addEventListener('error',()=>{clearTimeout(timeout);reject(Error('WS_CONNECT_FAILED'))},{once:true})});
69
+ const response=new Promise(resolve=>{const timeout=setTimeout(()=>resolve(null),12000);ws.addEventListener('message',evt=>{try{const x=JSON.parse(evt.data);if(x.id===42){clearTimeout(timeout);resolve(x)}}catch{}})});
70
+ ws.send(JSON.stringify({id:42,method:'Page.navigate',params:{url:base+'/integrations'}}));
71
+ const result=await response;flags.navigationCommandSuccess=!!result&&!result.error&&!result.result?.errorText;
72
+ await wait(4000);
73
+ }
74
+ const http=await fetch(base+'/integrations',{signal:AbortSignal.timeout(6000)}).catch(()=>null);
75
+ flags.httpIntegrationsStatus=http?.status||0;
76
+ const post=await targets();
77
+ flags.postNavTargetCount=post.length;
78
+ flags.postNavLocalTargetCount=post.filter(x=>group(x.url)!=='NON_LOCAL'&&group(x.url)!=='BAD_URL').length;
79
+ flags.postGroups=[...new Set(post.filter(x=>x.type==='page').map(x=>group(x.url)))].sort();
80
+ flags.windowsProcessAlive=app.exitCode===null;
81
+ }catch(e){flags.errorClass=String(e.message||e).replace(/[^A-Za-z0-9_]/g,'_').slice(0,60)}
82
+ finally{try{ws?.close()}catch{}if(app?.pid){try{execFileSync('taskkill.exe',['/PID',String(app.pid),'/T','/F'],{stdio:'ignore',timeout:15000})}catch{}}}
83
+ for(const [k,v] of Object.entries(flags))console.log('ROUTE_'+k+'='+JSON.stringify(v));
84
+ if(!(flags.ready&&flags.bankDisabled&&flags.cdpTarget))process.exitCode=1;
85
+ '@ | Set-Content -LiteralPath $probe -Encoding utf8
86
+ node $probe $env:TF_ORIGINAL_EXE
87
+ if($LASTEXITCODE -ne 0){throw 'ORIGINAL_V6_NATIVE_ROUTE_PROBE_FAILED'}
88
+ Write-Host 'GATE_PASS_ORIGINAL_V6_CDP_LAUNCH_AND_BANK_DISABLED'
89
+ - name: Scope and data protection
90
+ if: always()
91
+ run: |
92
+ Write-Host 'ORIGINAL_V6_PROBE=ROUTE_CLASSIFICATION_ONLY; REAL_SQL=NOT_TESTED; GUI_ACCEPTANCE=NOT_TESTED; V7=NOT_TESTED'
93
+ Write-Host 'PRIVATE_BINARY_AND_SOURCE_NOT_UPLOADED'