Treasury & Bank Transfer Management System — سامانه مدیریت خزانه‌داری و حواله‌های بانکی

Remove secret-bearing one-shot V6 source test evaluation workflow after successful Windows gates

davoodmehraban89 committed Oct 17, 2026 at 23:08 UTC 70b4dca4cd3eb5db214e086beb05f9b81c103a59
1 file changed -155
.github/workflows/v6-isolated-failure-triage-once.yml deleted
-155
@@ -1,155 +0,0 @@
1 -name: V6 private SQL unit assertion fix candidate evaluation (NOT V7)
2 -on:
3 - push:
4 - branches: ['ci/public-windows-bridge-probe-20261017']
5 - paths: ['.github/workflows/v6-isolated-failure-triage-once.yml']
6 -permissions:
7 - contents: read
8 -concurrency:
9 - group: treasuryflow-v6-assertion-triage-once
10 - cancel-in-progress: false
11 -jobs:
12 - diagnose:
13 - name: Isolated Windows 2022 private V6 test triage
14 - runs-on: windows-2022
15 - timeout-minutes: 40
16 - defaults:
17 - run:
18 - shell: pwsh
19 - env:
20 - BANK_ADAPTER_MODE: disabled
21 - TREASURYFLOW_ENABLE_MAYAN_EXTERNAL_READ: '0'
22 - TREASURYFLOW_MAYAN_ENABLE_EXTERNAL_READ: '0'
23 - TREASURYFLOW_ENABLE_SQL_LAB: '0'
24 - TREASURYFLOW_DESKTOP_LOCAL: '1'
25 - steps:
26 - - name: Validate and extract approved private ZIP
27 - env:
28 - GH_TOKEN: ${{ secrets.TF_VALIDATION_READ_TOKEN }}
29 - run: |
30 - $ErrorActionPreference='Stop'
31 - if ([string]::IsNullOrWhiteSpace($env:GH_TOKEN)) { throw 'TOKEN_MISSING' }
32 - $zip=Join-Path $env:RUNNER_TEMP 'TreasuryFlow_Validation_Staging_20261017.zip'
33 - $root=Join-Path $env:RUNNER_TEMP 'tf-source'
34 - gh release download validation-inputs-20261017 --repo davoodmehraban89/TreasuryFlow-Validation-Private --pattern TreasuryFlow_Validation_Staging_20261017.zip --dir $env:RUNNER_TEMP 1>$null 2>$null
35 - if($LASTEXITCODE -ne 0){throw 'DOWNLOAD_FAILED'}
36 - if((Get-FileHash $zip -Algorithm SHA256).Hash -ine '9ce46ce2d2a437e08cbf28146b2cf2ac0ed078c71f1aeb537764390cdd3c552f'){throw 'ZIP_HASH_MISMATCH'}
37 - Expand-Archive -LiteralPath $zip -DestinationPath $root -Force
38 - $privatePatch=gh api 'repos/davoodmehraban89/TreasuryFlow-Validation-Private/contents/qa/patches/v6-sql-assertion-fix.mjs?ref=2265e7e370d254eaa09988164559b2cd0c10c0d7' 2>$null | ConvertFrom-Json
39 - if($LASTEXITCODE -ne 0 -or !$privatePatch.content){throw 'PRIVATE_PATCH_DOWNLOAD_FAILED'}
40 - $patchFile=Join-Path $env:RUNNER_TEMP 'private-v6-unit-patch.mjs'
41 - [IO.File]::WriteAllBytes($patchFile,[Convert]::FromBase64String(($privatePatch.content -replace '\\s','')))
42 - "TF_PATCH_FILE=$patchFile" >> $env:GITHUB_ENV
43 - if(!(Test-Path -LiteralPath (Join-Path $root 'package.json'))){throw 'INVALID_ROOT'}
44 - "TF_STAGE=$root" >> $env:GITHUB_ENV
45 - Write-Host 'PRIVATE_ZIP_SHA256_PASS'
46 - - name: Install Node 22 without private token
47 - uses: actions/setup-node@v4
48 - with:
49 - node-version: '22'
50 - - name: Reproduce unit assertion and emit only finite safe classification tags
51 - run: |
52 - $ErrorActionPreference='Continue'
53 - $PSNativeCommandUseErrorActionPreference=$false
54 - Set-Location -LiteralPath $env:TF_STAGE
55 - node $env:TF_PATCH_FILE $env:TF_STAGE
56 - if ($LASTEXITCODE -ne 0) { throw 'PRIVATE_UNIT_PATCH_NOT_APPLICABLE' }
57 - $install=Join-Path $env:RUNNER_TEMP 'private-npm-install.log'
58 - npm ci --no-audit --no-fund *> $install
59 - if($LASTEXITCODE -ne 0){throw 'PRIVATE_NPM_INSTALL_FAILED'}
60 - Write-Host 'GATE_PASS_NPM_CI'
61 - $report=Join-Path $env:RUNNER_TEMP 'private-tests.json'
62 - $output=Join-Path $env:RUNNER_TEMP 'private-tests-console.txt'
63 - npm test -- --reporter=json "--outputFile=$report" *> $output
64 - $testExit=$LASTEXITCODE
65 - if(!(Test-Path -LiteralPath $report)){throw 'TEST_JSON_NOT_PRODUCED'}
66 - @'
67 - import fs from 'node:fs';
68 - import path from 'node:path';
69 - const report=JSON.parse(fs.readFileSync(process.argv[2],'utf8'));
70 - const suites=(report.testResults||[]);
71 - const fails=suites.flatMap(s=>(s.assertionResults||[]).filter(a=>a.status==='failed'));
72 - console.log('SUMMARY tests='+Number(report.numTotalTests||0)+' passed='+Number(report.numPassedTests||0)+' failed='+Number(report.numFailedTests||0)+' pending='+Number(report.numPendingTests||0)+' todo='+Number(report.numTodoTests||0));
73 - console.log('FAILURE_COUNT='+fails.length);
74 - const known=['textarea','select','editable','placeholder','copy','clipboard','sql','query','readonly','read-only','aria','button','role','tab','value','defaultvalue','data-testid','outerhtml','attribute','textcontent'];
75 - const detect=s=>known.filter(k=>s.toLowerCase().includes(k));
76 - for(const fail of fails.slice(0,4)){
77 - const msg=(fail.failureMessages||[]).join(' ');
78 - const safeTitle=/^[a-zA-Z0-9 ,.()!?-]{1,120}$/.test(fail.title||'')?fail.title:'[REDACTED]';
79 - console.log('FAIL_TEST_TITLE='+safeTitle);
80 - console.log('FAIL_ERROR_CLASS='+(msg.match(/(AssertionError|TypeError|ReferenceError|SyntaxError|RangeError|TimeoutError)/)?.[1]||'OTHER'));
81 - console.log('FAIL_MESSAGE_HAS_EXPECTED_TO_CONTAIN=' + /to contain|toContain/i.test(msg));
82 - console.log('FAIL_MESSAGE_HAS_NEGATION=' + /not to contain|not.toContain/i.test(msg));
83 - console.log('FAIL_MESSAGE_TAGS='+detect(msg).join(','));
84 - const loc=[...msg.matchAll(/\.(?:test|spec)\.tsx?:(\d+):(\d+)/g)].map(m=>m[1]);
85 - console.log('ASSERT_LINE_IN_SPEC='+(loc[0]||'UNAVAILABLE'));
86 - }
87 - const target='shows actual editable, selectable SQL rather than a placeholder-only code snippet';
88 - const dir=process.cwd();let found=false;
89 - function scan(d,depth){
90 - if(depth>12)return;
91 - for(const ent of fs.readdirSync(d,{withFileTypes:true})){
92 - if(['node_modules','.next','.git','.cache','release'].includes(ent.name))continue;
93 - const p=path.join(d,ent.name);
94 - if(ent.isDirectory())scan(p,depth+1);
95 - else if(/\.(?:test|spec)\.[jt]sx?$/.test(ent.name)&&fs.statSync(p).size<160000){
96 - const src=fs.readFileSync(p,'utf8');
97 - const index=src.indexOf(target);
98 - if(index!==-1){
99 - found=true;
100 - const rest=src.slice(index,index+3300);
101 - const chunk=rest.split(/\n\s*(?:it|test)\s*\(/)[0];
102 - console.log('TARGET_SPEC_PRESENT=true');
103 - console.log('TARGET_SPEC_EXPECT_COUNT='+(chunk.match(/\bexpect\s*\(/g)||[]).length);
104 - console.log('TARGET_SPEC_TERMS='+detect(chunk).join(','));
105 - const lines=src.split(String.fromCharCode(10));
106 - const focus=lines[12]||'';
107 - const op=focus.includes('.not.toContain(')?'NOT_CONTAIN':focus.includes('.toContain(')?'CONTAIN':focus.includes('.toMatch(')?'MATCH':focus.includes('.toBe(')?'TO_BE':focus.includes('.toEqual(')?'TO_EQUAL':'OTHER';
108 - console.log('ASSERT_LINE_13_OPERATOR='+op);
109 - console.log('ASSERT_LINE_13_SAFE_TERMS='+detect(focus).join(','));
110 - const tail=focus.split('.toContain(')[1]||''; const desired=tail.length>1 ? tail.slice(1).split(tail[0])[0] : '';
111 - console.log('ASSERT_EXPECTED_LENGTH='+desired.length);
112 - const tags=['SELECT','TOP','SQL','READ','ReadOnly','readonly','code','placeholder','textarea','button','pre','query','select','edit','copy','aria','disabled','readOnly','نام','کوئری','انتخاب','کپی','واقعی'];
113 - console.log('ASSERT_EXPECTED_SAFE_TERMS='+tags.filter(x=>desired.toLowerCase().includes(x.toLowerCase())).join(','));
114 - console.log('ASSERT_EXPECTED_ASCII_ONLY='+[...desired].every(c=>c.charCodeAt(0)<128));
115 - console.log('TARGET_SPEC_HAS_RENDER_STATIC='+/renderToStaticMarkup/.test(chunk));
116 - console.log('TARGET_SPEC_HAS_SOURCE_READ='+/readFileSync|readFile|fetch\(/.test(chunk));
117 - }
118 - }
119 - }
120 - }
121 - scan(dir,0);if(!found)console.log('TARGET_SPEC_PRESENT=false');
122 - '@ | Set-Content -LiteralPath (Join-Path $env:RUNNER_TEMP 'classify-private.mjs') -Encoding utf8
123 - node (Join-Path $env:RUNNER_TEMP 'classify-private.mjs') $report
124 - if($testExit -ne 0){throw 'V6_TESTS_STILL_FAILING_PRIVATE_OUTPUT_SUPPRESSED'}
125 - Write-Host 'V6_TESTS_PASS'
126 - - name: Evaluate independently lint and Next build after green unit tests
127 - run: |
128 - $ErrorActionPreference='Continue'
129 - $PSNativeCommandUseErrorActionPreference=$false
130 - Set-Location -LiteralPath $env:TF_STAGE
131 - npm run lint *> (Join-Path $env:RUNNER_TEMP 'private-lint.log')
132 - if($LASTEXITCODE -ne 0){throw 'PRIVATE_STAGE_LINT_FAILED'}
133 - Write-Host 'GATE_PASS_LINT'
134 - npm run build *> (Join-Path $env:RUNNER_TEMP 'private-next-build.log')
135 - if($LASTEXITCODE -ne 0){throw 'PRIVATE_STAGE_BUILD_FAILED'}
136 - Write-Host 'GATE_PASS_NEXT_BUILD'
137 - - name: Compile and verify native bridge without external SQL or bank
138 - run: |
139 - $ErrorActionPreference='Continue'
140 - $PSNativeCommandUseErrorActionPreference=$false
141 - Set-Location -LiteralPath $env:TF_STAGE
142 - & ./scripts/build-mayan-native.ps1 *> (Join-Path $env:RUNNER_TEMP 'private-native-build.log')
143 - if($LASTEXITCODE -ne 0){throw 'PRIVATE_NATIVE_BUILD_FAILED'}
144 - $exe=Join-Path $env:TF_STAGE 'native/MayanInterop/TreasuryFlow.MayanInterop.exe'
145 - if(!(Test-Path -LiteralPath $exe)){throw 'PRIVATE_NATIVE_OUTPUT_MISSING'}
146 - $h=(Get-FileHash -LiteralPath $exe -Algorithm SHA256).Hash
147 - $v=(& $exe verify-assembly $exe $h | ConvertFrom-Json)
148 - if($LASTEXITCODE -ne 0 -or !$v.ok -or $v.loadedForExecution -ne $false){throw 'PRIVATE_NATIVE_SELF_CHECK_FAILED'}
149 - Write-Host 'GATE_PASS_NATIVE_COMPILE_AND_VERIFICATION'
150 - - name: Always disclose isolated scope only
151 - if: always()
152 - run: |
153 - Write-Host 'VALIDATION_SCOPE=PRIVATE_V6_UNIT_TESTS_ONLY'
154 - Write-Host 'SQL_SERVER=NOT_TESTED; WINDOWS_GUI=NOT_TESTED; NATIVE_BRIDGE=NOT_TESTED; V7=NOT_TESTED'
155 - Write-Host 'NO_PUBLIC_PRIVATE_SOURCE_OR_BINARIES'