Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
Run temporary isolated V6 unit assertion triage with finite sanitized metadata
davoodmehraban89 committed
Oct 17, 2026 at 22:57 UTC
f843cd9bc2894597037cace0b943822be8c8ac05
1 file changed
+114
.github/workflows/v6-isolated-failure-triage-once.yml
new
+114
@@ -0,0 +1,114 @@
1
+name: V6 isolated test assertion triage (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
+ if(!(Test-Path -LiteralPath (Join-Path $root 'package.json'))){throw 'INVALID_ROOT'}
39
+ "TF_STAGE=$root" >> $env:GITHUB_ENV
40
+ Write-Host 'PRIVATE_ZIP_SHA256_PASS'
41
+ - name: Install Node 22 without private token
42
+ uses: actions/setup-node@v4
43
+ with:
44
+ node-version: '22'
45
+ - name: Reproduce unit assertion and emit only finite safe classification tags
46
+ run: |
47
+ $ErrorActionPreference='Continue'
48
+ $PSNativeCommandUseErrorActionPreference=$false
49
+ Set-Location -LiteralPath $env:TF_STAGE
50
+ $install=Join-Path $env:RUNNER_TEMP 'private-npm-install.log'
51
+ npm ci --no-audit --no-fund *> $install
52
+ if($LASTEXITCODE -ne 0){throw 'PRIVATE_NPM_INSTALL_FAILED'}
53
+ Write-Host 'GATE_PASS_NPM_CI'
54
+ $report=Join-Path $env:RUNNER_TEMP 'private-tests.json'
55
+ $output=Join-Path $env:RUNNER_TEMP 'private-tests-console.txt'
56
+ npm test -- --reporter=json "--outputFile=$report" *> $output
57
+ $testExit=$LASTEXITCODE
58
+ if(!(Test-Path -LiteralPath $report)){throw 'TEST_JSON_NOT_PRODUCED'}
59
+ @'
60
+ import fs from 'node:fs';
61
+ import path from 'node:path';
62
+ const report=JSON.parse(fs.readFileSync(process.argv[2],'utf8'));
63
+ const suites=(report.testResults||[]);
64
+ const fails=suites.flatMap(s=>(s.assertionResults||[]).filter(a=>a.status==='failed'));
65
+ 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));
66
+ console.log('FAILURE_COUNT='+fails.length);
67
+ const known=['textarea','select','editable','placeholder','copy','clipboard','sql','query','readonly','read-only','aria','button','role','tab','value','defaultvalue','data-testid','outerhtml','attribute','textcontent'];
68
+ const detect=s=>known.filter(k=>s.toLowerCase().includes(k));
69
+ for(const fail of fails.slice(0,4)){
70
+ const msg=(fail.failureMessages||[]).join(' ');
71
+ const safeTitle=/^[a-zA-Z0-9 ,.()!?-]{1,120}$/.test(fail.title||'')?fail.title:'[REDACTED]';
72
+ console.log('FAIL_TEST_TITLE='+safeTitle);
73
+ console.log('FAIL_ERROR_CLASS='+(msg.match(/(AssertionError|TypeError|ReferenceError|SyntaxError|RangeError|TimeoutError)/)?.[1]||'OTHER'));
74
+ console.log('FAIL_MESSAGE_HAS_EXPECTED_TO_CONTAIN=' + /to contain|toContain/i.test(msg));
75
+ console.log('FAIL_MESSAGE_HAS_NEGATION=' + /not to contain|not.toContain/i.test(msg));
76
+ console.log('FAIL_MESSAGE_TAGS='+detect(msg).join(','));
77
+ const loc=[...msg.matchAll(/\.(?:test|spec)\.tsx?:(\d+):(\d+)/g)].map(m=>m[1]);
78
+ console.log('ASSERT_LINE_IN_SPEC='+(loc[0]||'UNAVAILABLE'));
79
+ }
80
+ const target='shows actual editable, selectable SQL rather than a placeholder-only code snippet';
81
+ const dir=process.cwd();let found=false;
82
+ function scan(d,depth){
83
+ if(depth>12)return;
84
+ for(const ent of fs.readdirSync(d,{withFileTypes:true})){
85
+ if(['node_modules','.next','.git','.cache','release'].includes(ent.name))continue;
86
+ const p=path.join(d,ent.name);
87
+ if(ent.isDirectory())scan(p,depth+1);
88
+ else if(/\.(?:test|spec)\.[jt]sx?$/.test(ent.name)&&fs.statSync(p).size<160000){
89
+ const src=fs.readFileSync(p,'utf8');
90
+ const index=src.indexOf(target);
91
+ if(index!==-1){
92
+ found=true;
93
+ const rest=src.slice(index,index+3300);
94
+ const chunk=rest.split(/\n\s*(?:it|test)\s*\(/)[0];
95
+ console.log('TARGET_SPEC_PRESENT=true');
96
+ console.log('TARGET_SPEC_EXPECT_COUNT='+(chunk.match(/\bexpect\s*\(/g)||[]).length);
97
+ console.log('TARGET_SPEC_TERMS='+detect(chunk).join(','));
98
+ console.log('TARGET_SPEC_HAS_RENDER_STATIC='+/renderToStaticMarkup/.test(chunk));
99
+ console.log('TARGET_SPEC_HAS_SOURCE_READ='+/readFileSync|readFile|fetch\(/.test(chunk));
100
+ }
101
+ }
102
+ }
103
+ }
104
+ scan(dir,0);if(!found)console.log('TARGET_SPEC_PRESENT=false');
105
+ '@ | Set-Content -LiteralPath (Join-Path $env:RUNNER_TEMP 'classify-private.mjs') -Encoding utf8
106
+ node (Join-Path $env:RUNNER_TEMP 'classify-private.mjs') $report
107
+ if($testExit -ne 0){throw 'V6_TESTS_STILL_FAILING_PRIVATE_OUTPUT_SUPPRESSED'}
108
+ Write-Host 'V6_TESTS_PASS'
109
+ - name: Always disclose isolated scope only
110
+ if: always()
111
+ run: |
112
+ Write-Host 'VALIDATION_SCOPE=PRIVATE_V6_UNIT_TESTS_ONLY'
113
+ Write-Host 'SQL_SERVER=NOT_TESTED; WINDOWS_GUI=NOT_TESTED; NATIVE_BRIDGE=NOT_TESTED; V7=NOT_TESTED'
114
+ Write-Host 'NO_PUBLIC_PRIVATE_SOURCE_OR_BINARIES'