Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
Remove consolidated secret-scoped V6 repaired SQL+SheetJS+Windows NSIS GUI workflow after all gates pass
davoodmehraban89 committed
Oct 18, 2026 at 22:29 UTC
ef717843e765f8f26a4ee4714a9fb2a99ff000ee
1 file changed
-296
.github/workflows/v6-consolidated-patched-sql-xlsx-windows-once.yml
deleted
-296
@@ -1,296 +0,0 @@
1
-name: V6 consolidated SQL view-only adapter plus zero-risk SheetJS and Windows NSIS GUI gates (NOT V7)
2
-on:
3
- push:
4
- branches: ['ci/public-windows-bridge-probe-20261017']
5
- paths: ['.github/workflows/v6-consolidated-patched-sql-xlsx-windows-once.yml']
6
-permissions:
7
- contents: read
8
-concurrency:
9
- group: tf-v6-rebuilt-gui-one-shot
10
- cancel-in-progress: false
11
-jobs:
12
- windows-acceptance:
13
- runs-on: windows-2022
14
- timeout-minutes: 85
15
- defaults:
16
- run:
17
- shell: pwsh
18
- env:
19
- BANK_ADAPTER_MODE: disabled
20
- TREASURYFLOW_ENABLE_MAYAN_EXTERNAL_READ: '0'
21
- TREASURYFLOW_MAYAN_ENABLE_EXTERNAL_READ: '0'
22
- TREASURYFLOW_ENABLE_SQL_LAB: '0'
23
- TREASURYFLOW_DESKTOP_LOCAL: '1'
24
- NEXT_TELEMETRY_DISABLED: '1'
25
- ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES: 'false'
26
- steps:
27
- - name: Download exact V6 archive and private guarded repair with read-only step token
28
- env:
29
- GH_TOKEN: ${{ secrets.TF_VALIDATION_READ_TOKEN }}
30
- run: |
31
- $ErrorActionPreference='Stop'
32
- if([string]::IsNullOrWhiteSpace($env:GH_TOKEN)){throw 'PRIVATE_TOKEN_MISSING'}
33
- $input=Join-Path $env:RUNNER_TEMP 'private-input'
34
- $stage=Join-Path $env:RUNNER_TEMP 'private-stage'
35
- New-Item -ItemType Directory -Force -Path $input,$stage | Out-Null
36
- gh release download validation-inputs-20261017 --repo davoodmehraban89/TreasuryFlow-Validation-Private --pattern TreasuryFlow_Validation_Staging_20261017.zip --dir $input 1>$null 2>$null
37
- if($LASTEXITCODE -ne 0){throw 'PRIVATE_ZIP_DOWNLOAD_FAILED'}
38
- $zip=Join-Path $input 'TreasuryFlow_Validation_Staging_20261017.zip'
39
- if((Get-FileHash $zip -Algorithm SHA256).Hash -ine '9ce46ce2d2a437e08cbf28146b2cf2ac0ed078c71f1aeb537764390cdd3c552f'){throw 'STAGING_SHA256_FAILED'}
40
- Expand-Archive -LiteralPath $zip -DestinationPath $stage -Force
41
- if(!(Test-Path -LiteralPath (Join-Path $stage 'package.json'))){throw 'STAGING_ROOT_MISSING'}
42
- $raw=gh api 'repos/davoodmehraban89/TreasuryFlow-Validation-Private/contents/qa/patches/v6-sql-assertion-fix.mjs?ref=2265e7e370d254eaa09988164559b2cd0c10c0d7' 2>$null | ConvertFrom-Json
43
- if($LASTEXITCODE -ne 0 -or !$raw.content){throw 'PRIVATE_PATCH_FETCH_FAILED'}
44
- $patch=Join-Path $env:RUNNER_TEMP 'v6-private-test-assertion-fix.mjs'
45
- [IO.File]::WriteAllBytes($patch,[Convert]::FromBase64String(($raw.content -replace '\s','')))
46
- "TF_PRIVATE_STAGE=$stage" >> $env:GITHUB_ENV
47
- "TF_PRIVATE_PATCH=$patch" >> $env:GITHUB_ENV
48
- $sqlScript=gh api 'repos/davoodmehraban89/TreasuryFlow-Validation-Private/contents/qa/patches/v6-add-readonly-sqlserver-adapter.mjs?ref=1ee794c1cce62e64b97c32769e5b6aca0f2fa58c' 2>$null | ConvertFrom-Json
49
- if($LASTEXITCODE -ne 0 -or !$sqlScript.content){throw 'PRIVATE_SQL_ADDITIVE_PATCH_NOT_FOUND'}
50
- $privateSqlPatch=Join-Path $env:RUNNER_TEMP 'tf-private-approved-view-sql-patch.mjs'
51
- [IO.File]::WriteAllBytes($privateSqlPatch,[Convert]::FromBase64String(($sqlScript.content -replace '\s','')))
52
- "TF_PRIVATE_SQL_PATCH=$privateSqlPatch" >> $env:GITHUB_ENV
53
- Write-Host 'GATE_PASS_STAGING_PRIVATE_PROVENANCE'
54
- - name: Setup Node 22 with private token absent
55
- uses: actions/setup-node@v4
56
- with:
57
- node-version: '22'
58
- - name: Patch exact test assertion and run all source gates without raw private logs
59
- run: |
60
- $ErrorActionPreference='Continue'
61
- $PSNativeCommandUseErrorActionPreference=$false
62
- Set-Location -LiteralPath $env:TF_PRIVATE_STAGE
63
- node $env:TF_PRIVATE_PATCH $env:TF_PRIVATE_STAGE *> (Join-Path $env:RUNNER_TEMP 'private-patch.log')
64
- if($LASTEXITCODE -ne 0){throw 'GUARDED_SQL_ASSERTION_PATCH_FAILED'}
65
- Write-Host 'GATE_PASS_GUARDED_ASSERTION_PATCH'
66
- node $env:TF_PRIVATE_SQL_PATCH $env:TF_PRIVATE_STAGE *> (Join-Path $env:RUNNER_TEMP 'private-sql-patch.log')
67
- if($LASTEXITCODE -ne 0){throw 'PRIVATE_APPROVED_VIEW_SQL_ADAPTER_PATCH_FAILED'}
68
- Write-Host 'GATE_PASS_ADDITIVE_APPROVED_VIEW_SQL_ADAPTER_PATCH'
69
- npm ci --no-audit --no-fund *> (Join-Path $env:RUNNER_TEMP 'private-install-before-sheetjs.log')
70
- if($LASTEXITCODE -ne 0){throw 'INITIAL_NPM_CI_FAILED'}
71
- $vendor=Join-Path $env:RUNNER_TEMP 'sheetjs-official-0.20.3.tgz'
72
- Invoke-WebRequest -Uri 'https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz' -OutFile $vendor -TimeoutSec 120
73
- $hash=(Get-FileHash -LiteralPath $vendor -Algorithm SHA256).Hash
74
- if($hash -ine '8dc73fc3b00203e72d176e85b50938627c7b086e607c682e8d3c22c02bb99fe8'){throw 'VENDOR_OFFICIAL_SHEETJS_TARBALL_SHA_MISMATCH'}
75
- npm uninstall xlsx --save --no-audit --no-fund *> (Join-Path $env:RUNNER_TEMP 'private-uninstall-old-xlsx.log')
76
- if($LASTEXITCODE -ne 0){throw 'REMOVE_VULNERABLE_XLSX_FAILED'}
77
- npm install --save --ignore-scripts --no-audit --no-fund 'https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz' *> (Join-Path $env:RUNNER_TEMP 'private-install-official-xlsx.log')
78
- if($LASTEXITCODE -ne 0){throw 'INSTALL_OFFICIAL_SHEETJS_FAILED'}
79
- node -e "if(require('xlsx').version!=='0.20.3')process.exit(1)" *> (Join-Path $env:RUNNER_TEMP 'private-sheetjs-version.log')
80
- if($LASTEXITCODE -ne 0){throw 'INVALID_SHEETJS_PATCHED_VERSION'}
81
- npm audit fix --omit=dev --no-fund *> (Join-Path $env:RUNNER_TEMP 'private-safe-audit-fix.log')
82
- if($LASTEXITCODE -ne 0){Write-Host 'NOTE_NPM_AUDIT_FIX_EXIT_NONZERO_WILL_VERIFY_FINAL_AUDIT'}
83
- npm ci --no-audit --no-fund *> (Join-Path $env:RUNNER_TEMP 'private-post-patch-ci.log')
84
- if($LASTEXITCODE -ne 0){throw 'REPRODUCIBLE_PATCHED_CI_FAILED'}
85
- $audit=Join-Path $env:RUNNER_TEMP 'private-audit-patched.json'
86
- npm audit --omit=dev --json 1> $audit 2> (Join-Path $env:RUNNER_TEMP 'private-audit-errors.log')
87
- $vulns=(Get-Content -LiteralPath $audit -Raw | ConvertFrom-Json).metadata.vulnerabilities
88
- Write-Host ("PATCHED_XLSX_PRODUCTION_AUDIT_HIGH="+[int]$vulns.high)
89
- Write-Host ("PATCHED_XLSX_PRODUCTION_AUDIT_CRITICAL="+[int]$vulns.critical)
90
- Write-Host ("PATCHED_XLSX_PRODUCTION_AUDIT_MODERATE="+[int]$vulns.moderate)
91
- Write-Host ("PATCHED_XLSX_PRODUCTION_AUDIT_TOTAL="+[int]$vulns.total)
92
- if([int]$vulns.total -gt 0){throw 'PRODUCTION_AUDIT_STILL_HAS_KNOWN_VULNERABILITIES'}
93
- Write-Host 'GATE_PASS_ZERO_KNOWN_PRODUCTION_NPM_ADVISORIES'
94
- Write-Host 'GATE_PASS_SHEETJS_0_20_3_SHA_PINNED_WINDOWS_SECURITY_GATE'
95
- node --test src/platform/integration/readonly-sql-policy.node.mjs *> (Join-Path $env:RUNNER_TEMP 'private-sql-policy-original.log')
96
- if($LASTEXITCODE -ne 0){throw 'V6_EXISTING_SQL_POLICY_GATE_FAILED'}
97
- Write-Host 'GATE_PASS_EXISTING_SQL_LEXICAL_GUARD'
98
- $gates=@(
99
- @{label='UNIT_TESTS';argv=@('test','--','--reporter=dot')},
100
- @{label='TYPECHECK';argv=@('run','typecheck')},
101
- @{label='LINT';argv=@('run','lint')},
102
- @{label='NEXT_BUILD';argv=@('run','build')}
103
- )
104
- foreach($g in $gates){
105
- & npm @($g.argv) *> (Join-Path $env:RUNNER_TEMP ("private-gate-"+$g.label+".log"))
106
- if($LASTEXITCODE -ne 0){throw ("GATE_FAIL_"+$g.label+"_PRIVATE_OUTPUT_WITHHELD")}
107
- Write-Host ("GATE_PASS_"+$g.label)
108
- }
109
- node scripts/prepare-standalone.mjs *> (Join-Path $env:RUNNER_TEMP 'private-standalone.log')
110
- if($LASTEXITCODE -ne 0){throw 'GATE_FAIL_STANDALONE'}
111
- Write-Host 'GATE_PASS_STANDALONE'
112
- npm run smoke *> (Join-Path $env:RUNNER_TEMP 'private-standalone-smoke.log')
113
- if($LASTEXITCODE -ne 0){throw 'GATE_FAIL_STANDALONE_SMOKE'}
114
- Write-Host 'GATE_PASS_STANDALONE_SMOKE'
115
- - name: Build an actual ephemeral NSIS Setup from patched private V6 staging
116
- run: |
117
- $ErrorActionPreference='Continue'
118
- $PSNativeCommandUseErrorActionPreference=$false
119
- Set-Location -LiteralPath $env:TF_PRIVATE_STAGE
120
- $log=Join-Path $env:RUNNER_TEMP 'private-installer-build.log'
121
- & npx --no-install electron-builder --win nsis --x64 --publish never *> $log
122
- $builderExit=$LASTEXITCODE
123
- $txt=if(Test-Path -LiteralPath $log){Get-Content -LiteralPath $log -Raw}else{''}
124
- $classes=[ordered]@{
125
- SIGNING='code.sign|signature|signing|certificate|CSC_'
126
- NSIS_TOOL='makensis|nsis|appBuilder'
127
- DOWNLOAD='download|fetch|network|ECONNRESET|ETIMEDOUT|ENOTFOUND'
128
- FILE_MISSING='ENOENT|no.such.file|not.found|file.does.not.exist|missing'
129
- MODULE_MISSING='cannot.find.module|module.not.found|require.stack'
130
- FILE_LOCK='EPERM|EACCES|access.is.denied'
131
- CONFIG='configuration|invalid.config|schema|unsupported.target'
132
- ASAR='asar|cannot.pack|archive'
133
- PATH='path.too.long|filename.too.long'
134
- DEPENDENCIES='dependencies|node_modules|npmRebuild|rebuild'
135
- ELECTRON='electron|win-unpacked'
136
- GENERIC_ERROR='Error:|⨯|error'
137
- }
138
- foreach($k in $classes.Keys){Write-Host ("BUILDER_LOG_HAS_"+$k+"="+[bool]($txt -match $classes[$k]))}
139
- $outDir=Join-Path $env:TF_PRIVATE_STAGE 'release'
140
- $topLevelExe=@(Get-ChildItem -LiteralPath $outDir -File -Filter '*.exe' -ErrorAction SilentlyContinue)
141
- $nestedExe=@(Get-ChildItem -LiteralPath $outDir -Recurse -File -Filter '*.exe' -ErrorAction SilentlyContinue)
142
- $targetConfirmed=[bool]($txt -match 'target=nsis')
143
- Write-Host ("BUILDER_TOP_LEVEL_EXE_COUNT="+$topLevelExe.Count)
144
- Write-Host ("BUILDER_NESTED_EXE_COUNT="+$nestedExe.Count)
145
- Write-Host ("BUILDER_LOG_NSIS_TARGET_CONFIRMED="+$targetConfirmed)
146
- Write-Host ("BUILDER_PROCESS_EXIT_NONZERO="+[bool]($builderExit -ne 0))
147
- if($builderExit -ne 0){throw 'PRIVATE_V6_NSIS_BUILD_FAILED_SANITIZED_DIAGNOSTIC_ABOVE'}
148
- if(!$targetConfirmed){throw 'NSIS_TARGET_NOT_CONFIRMED_IN_BUILDER_LOG'}
149
- $setup=@($topLevelExe | Where-Object { $_.Name -match '^TreasuryFlow[-_ ].*[.]exe$' -and $_.Length -gt 1000000 })
150
- if($setup.Count -ne 1){throw 'PRIVATE_NSIS_TOP_LEVEL_INSTALLER_NOT_UNIQUE'}
151
- "TF_EPHEMERAL_NSIS_SETUP=$($setup[0].FullName)" >> $env:GITHUB_ENV
152
- Write-Host 'GATE_PASS_PRIVATE_V6_NSIS_INSTALLER_BUILD'
153
- Write-Host ('INSTALLER_SHA256='+((Get-FileHash $setup[0].FullName -Algorithm SHA256).Hash))
154
- - name: Install actual private V6 NSIS Setup into isolated Windows VM
155
- id: install
156
- run: |
157
- $ErrorActionPreference='Stop'
158
- $dest=Join-Path $env:RUNNER_TEMP 'TreasuryFlow-V6-Isolated-Installed'
159
- $process=Start-Process -FilePath $env:TF_EPHEMERAL_NSIS_SETUP -ArgumentList @('/S',('/D='+$dest)) -PassThru
160
- if(!$process.WaitForExit(240000)){try{$process.Kill()}catch{};throw 'V6_NSIS_INSTALL_TIMEOUT'}
161
- if($process.ExitCode -ne 0){throw 'V6_NSIS_NONZERO_EXIT'}
162
- $installed=@(Get-ChildItem -LiteralPath $dest -Recurse -Filter 'TreasuryFlow.exe' -File -ErrorAction SilentlyContinue)
163
- if($installed.Count -ne 1){throw 'INSTALLED_V6_EXE_NOT_UNIQUE'}
164
- "TF_INSTALLED_V6_EXE=$($installed[0].FullName)" >> $env:GITHUB_ENV
165
- "TF_V6_INSTALL_DIR=$dest" >> $env:GITHUB_ENV
166
- Write-Host 'GATE_PASS_ACTUAL_V6_NSIS_INSTALL'
167
- - name: Real Electron GUI and OS clipboard acceptance using synthetic SQL only
168
- timeout-minutes: 18
169
- run: |
170
- $ErrorActionPreference='Continue'
171
- $PSNativeCommandUseErrorActionPreference=$false
172
- $probe=Join-Path $env:RUNNER_TEMP 'tf-native-gui-os-copy.mjs'
173
- @'
174
- import assert from 'node:assert/strict';
175
- import {spawn,execFileSync} from 'node:child_process';
176
- import {writeFileSync} from 'node:fs';
177
- import {join} from 'node:path';
178
- const exe=process.argv[2];const out=process.argv[3];
179
- const report={integrations:false,writable:false,select:false,copyButton:false,osClipboard:false,bankDisabled:false,stage:'START',status:'NOT_RUN'};
180
- const sleep=ms=>new Promise(ok=>setTimeout(ok,ms));
181
- async function wait(fn,ms=75000){const end=Date.now()+ms;while(Date.now()<end){try{let v=await fn();if(v)return v}catch{}await sleep(600)}throw Error('TIMEOUT_'+report.stage)}
182
- const port=9568,base='http://127.0.0.1:3210';
183
- async function wsConnect(url){
184
- const ws=new WebSocket(url);await new Promise((ok,no)=>{const t=setTimeout(()=>no(Error('WS_TIMEOUT')),10000);ws.addEventListener('open',()=>{clearTimeout(t);ok()},{once:true});ws.addEventListener('error',()=>{clearTimeout(t);no(Error('WS_ERROR'))},{once:true})});
185
- let id=0;const pending=new Map();
186
- ws.addEventListener('message',ev=>{let msg;try{msg=JSON.parse(ev.data)}catch{return}const p=pending.get(msg.id);if(!p)return;pending.delete(msg.id);clearTimeout(p.t);msg.error?p.no(Error('CDP_ERROR')):p.ok(msg.result)});
187
- const call=(method,params={})=>new Promise((ok,no)=>{const i=++id,t=setTimeout(()=>{pending.delete(i);no(Error('CDP_TIMEOUT'))},16000);pending.set(i,{ok,no,t});ws.send(JSON.stringify({id:i,method,params}))});
188
- const evalJs=async code=>{const r=await call('Runtime.evaluate',{expression:code,returnByValue:true,awaitPromise:true});if(r.exceptionDetails)throw Error('GUI_EVALUATION_ERROR');return r.result?.value};
189
- await call('Runtime.enable');await call('Page.enable');return {ws,call,evalJs};
190
- }
191
- let electronProcess,conn;
192
- try{
193
- report.stage='LAUNCH';
194
- const prev=await fetch(base+'/api/ready',{signal:AbortSignal.timeout(1600)}).then(()=>true,()=>false);
195
- assert(!prev,'STALE_SERVER');
196
- electronProcess=spawn(exe,['--remote-debugging-port='+port,'--remote-allow-origins=*'],{stdio:'ignore',windowsHide:false,env:{...globalThis.process.env,BANK_ADAPTER_MODE:'disabled',TREASURYFLOW_DESKTOP_LOCAL:'1',TREASURYFLOW_ENABLE_MAYAN_EXTERNAL_READ:'0',TREASURYFLOW_ENABLE_SQL_LAB:'0',TREASURYFLOW_DATA_FILE:join(out,'isolated-synthetic.sqlite')}});
197
- report.stage='BACKEND';
198
- const ready=await wait(async()=>{const x=await fetch(base+'/api/ready',{signal:AbortSignal.timeout(1500)});return x.ok?x.json():null});
199
- assert(ready.status==='ready'&&ready.bankAdapter==='disabled','READINESS_CONTRACT_INVALID');
200
- report.bankDisabled=true;
201
- report.stage='CDP';
202
- const pages=async()=>{const r=await fetch('http://127.0.0.1:'+port+'/json/list',{signal:AbortSignal.timeout(1500)});return r.ok?r.json():[]};
203
- const first=await wait(async()=>{const x=await pages();return x.find(y=>y.type==='page'&&y.url?.startsWith(base)&&y.webSocketDebuggerUrl)});
204
- conn=await wsConnect(first.webSocketDebuggerUrl);
205
- report.stage='GUI_STARTUP_SETTLING';
206
- await sleep(12000);
207
- const idleReady=await fetch(base+'/api/ready',{signal:AbortSignal.timeout(1800)}).then(x=>x.json()).catch(()=>null);
208
- assert(electronProcess.exitCode===null&&idleReady?.status==='ready'&&idleReady?.bankAdapter==='disabled','ELECTRON_NOT_STABLE_AFTER_12_SECONDS');
209
- report.idleStable=true;
210
- report.stage='LOCAL_ENTRY';
211
- const initial=await conn.evalJs("({path:location.pathname,entry:[...document.querySelectorAll('a[href]')].some(a=>a.getAttribute('href')==='/dashboard')})").catch(()=>null);
212
- report.entryInitialLogin=initial?.path==='/login';
213
- report.entryLinkPresent=!!initial?.entry;
214
- if(initial?.path==='/login'&&initial.entry){
215
- await conn.evalJs("(()=>{const a=[...document.querySelectorAll('a[href]')].find(a=>a.getAttribute('href')==='/dashboard');if(a){a.click();return true}return false})()").catch(()=>null);
216
- await sleep(1500);
217
- }
218
- report.stage='SQL_PAGE';
219
- const http=await fetch(base+'/integrations',{signal:AbortSignal.timeout(10000)}).catch(()=>null);
220
- report.sqlHttpStatus=http?.status||0;
221
- const navResult=await conn.call('Page.navigate',{url:base+'/integrations'}).catch(()=>null);
222
- report.cdpNavigateAccepted=!!navResult&&!navResult.errorText;
223
- await sleep(1200);
224
- let last='';
225
- await wait(async()=>{
226
- const x=await pages();
227
- const local=x.filter(z=>z.type==='page'&&z.url?.startsWith(base));
228
- if(local.some(z=>z.url===base+'/'||z.url===base))report.rootTargetSeen=true;
229
- if(local.some(z=>z.url?.startsWith(base+'/login')))report.loginTargetSeen=true;
230
- if(local.some(z=>z.url?.startsWith(base+'/dashboard')))report.dashboardTargetSeen=true;
231
- const p=local.find(z=>z.url?.startsWith(base+'/integrations')&&z.webSocketDebuggerUrl);
232
- if(p)report.integrationsTargetSeen=true;
233
- if(!p)return false;
234
- if(p.webSocketDebuggerUrl!==last){try{conn.ws.close()}catch{}conn=await wsConnect(p.webSocketDebuggerUrl);last=p.webSocketDebuggerUrl}
235
- const state=await conn.evalJs("({path:location.pathname,hasTextarea:!!document.querySelector('textarea')})");
236
- if(state?.path==='/integrations')report.integrationsDomSeen=true;
237
- return state?.path==='/integrations'&&state?.hasTextarea;
238
- });
239
- report.integrations=true;
240
- report.stage='EDITOR';
241
- const state=await conn.evalJs("(()=>{const f=document.querySelector('textarea');f.focus();f.select();return {ro:f.readOnly,disabled:f.disabled,buttons:[...document.querySelectorAll('button')].map(b=>b.textContent?.trim())}})()");
242
- assert(!state.ro&&!state.disabled,'SQL_EDITOR_NOT_EDITABLE');
243
- assert(state.buttons.some(x=>x?.includes('انتخاب متن')),'SELECT_BUTTON_MISSING');
244
- assert(state.buttons.some(x=>x?.includes('کپی کوئری')),'COPY_BUTTON_MISSING');
245
- report.copyButton=true;
246
- const sql='SELECT TOP (7) 7 AS ClipboardAcceptanceProbe';
247
- await conn.call('Input.insertText',{text:sql});
248
- await wait(()=>conn.evalJs('document.querySelector("textarea")?.value==='+JSON.stringify(sql)),10000);
249
- report.writable=true;
250
- report.stage='SELECTION';
251
- await conn.evalJs("(()=>{[...document.querySelectorAll('button')].find(b=>b.textContent?.includes('انتخاب متن')).click();return true})()");
252
- assert(await conn.evalJs("(()=>{const f=document.querySelector('textarea');return f.selectionStart===0&&f.selectionEnd===f.value.length})()"),'REAL_SELECT_TEXT_ACTION_FAILED');
253
- report.select=true;
254
- report.stage='WINDOWS_OS_CLIPBOARD';
255
- await conn.evalJs("(()=>{[...document.querySelectorAll('button')].find(b=>b.textContent?.includes('کپی کوئری')).click();return true})()");
256
- await wait(()=>execFileSync('powershell.exe',['-NoProfile','-NonInteractive','-Command','Get-Clipboard -Raw'],{encoding:'utf8',timeout:4500}).trim()===sql,15000);
257
- report.osClipboard=true;
258
- report.status='PASS';
259
- console.log('GATE_PASS_REAL_WINDOWS_INSTALLED_ELECTRON_SQL_COPY_AND_SELECT');
260
- }catch(e){report.status='FAIL';report.failure=String(e.message||e).slice(0,90).replace(/[^A-Za-z0-9_ ]/g,'_');console.error('GUI_GATE_FAIL_'+report.failure);globalThis.process.exitCode=1}
261
- finally{try{conn?.ws.close()}catch{}if(electronProcess?.pid){try{execFileSync('taskkill.exe',['/PID',String(electronProcess.pid),'/T','/F'],{stdio:'ignore',timeout:10000})}catch{}}writeFileSync(join(out,'private-gui-report.json'),JSON.stringify(report))}
262
- '@ | Set-Content -LiteralPath $probe -Encoding utf8
263
- $reportDir=Join-Path $env:RUNNER_TEMP 'private-tf-gui'
264
- New-Item -ItemType Directory -Force -Path $reportDir | Out-Null
265
- node $probe $env:TF_INSTALLED_V6_EXE $reportDir *> (Join-Path $env:RUNNER_TEMP 'private-gui-output.log')
266
- $result=Get-Content (Join-Path $reportDir 'private-gui-report.json') -Raw | ConvertFrom-Json
267
- foreach($key in @('integrations','writable','select','copyButton','osClipboard','bankDisabled','entryInitialLogin','entryLinkPresent','rootTargetSeen','loginTargetSeen','dashboardTargetSeen','integrationsTargetSeen','integrationsDomSeen','cdpNavigateAccepted','idleStable')){
268
- Write-Host ("GUI_"+$key+"="+[bool]$result.$key)
269
- }
270
- Write-Host ("GUI_SQL_HTTP_STATUS="+[int]$result.sqlHttpStatus)
271
- if($LASTEXITCODE -ne 0 -or $result.status -ne 'PASS'){throw ('INSTALLED_GUI_'+[string]$result.stage+'_FAILED')}
272
- Write-Host 'GATE_PASS_ACTUAL_WINDOWS_OS_CLIPBOARD'
273
- - name: Silent uninstall of actual private V6 Setup
274
- if: ${{ always() && steps.install.outcome == 'success' }}
275
- run: |
276
- $ErrorActionPreference='Stop'
277
- $uninstaller=@(Get-ChildItem $env:TF_V6_INSTALL_DIR -Recurse -File -ErrorAction SilentlyContinue | Where-Object {$_.Name -match '^uninstall.*\.exe$'})
278
- if($uninstaller.Count -ne 1){throw 'V6_NSIS_UNINSTALLER_NOT_FOUND'}
279
- @(Get-Process -Name 'TreasuryFlow' -ErrorAction SilentlyContinue) | ForEach-Object { try{Stop-Process -Id $_.Id -Force -ErrorAction Stop}catch{} }
280
- $proc=Start-Process -FilePath $uninstaller[0].FullName -ArgumentList '/S' -PassThru
281
- if(!$proc.WaitForExit(90000)){try{$proc.Kill()}catch{};throw 'V6_UNINSTALL_TIMEOUT'}
282
- if($proc.ExitCode -ne 0){throw 'V6_UNINSTALL_NONZERO'}
283
- $removed=$false
284
- for($i=0;$i -lt 90;$i++){
285
- $remaining=@(Get-ChildItem $env:TF_V6_INSTALL_DIR -Recurse -File -Filter 'TreasuryFlow.exe' -ErrorAction SilentlyContinue)
286
- if($remaining.Count -eq 0){$removed=$true;break}
287
- Start-Sleep -Seconds 1
288
- }
289
- if(!$removed){throw 'V6_UNINSTALL_LEFT_EXECUTABLE_AFTER_90_SECONDS'}
290
- Write-Host 'GATE_PASS_REAL_V6_NSIS_UNINSTALL'
291
- - name: Strictly bound scope of this validation
292
- if: always()
293
- run: |
294
- Write-Host 'PRIVATE_SOURCE_BINARY_AND_RAW_TEST_LOGS=NOT_UPLOADED'
295
- Write-Host 'PRODUCTION_BANK_DISABLED=true; MAYAN_EXTERNAL_READ_DISABLED=true'
296
- Write-Host 'V7_FINAL_ACCEPTANCE=NOT_TESTED; SQL_SERVER_APP_ADAPTER=NOT_TESTED; UPGRADE_ROLLBACK=NOT_TESTED'