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

release: finalize verified Windows portable runtime

Davood Mehraban committed Oct 5, 2026 at 22:12 UTC 2cc2e2efc1823fd98df9020209bc6408226ac1ad
5 files changed +32 -3
.gitignore
+2
@@ -6,3 +6,5 @@ node_modules/
6
7 .next/
8 *.tsbuildinfo
9 +
10 +release/
docs/FINAL_DESKTOP_RELEASE_GATE.md new
+23
@@ -0,0 +1,23 @@
1 +# TreasuryFlow Final Desktop Release Gate
2 +
3 +Date: 2026-10-05
4 +Version: 0.1.0
5 +
6 +## Verified
7 +- TypeScript strict: PASS
8 +- Vitest: 94/94 PASS across 39 files
9 +- ESLint source gate: PASS
10 +- Next.js 16.3.8 production build: PASS
11 +- npm production audit: 0 vulnerabilities
12 +- Clean-install portable runtime smoke: PASS
13 +- /api/ready: HTTP 200, bank adapter disabled
14 +- Home UI: HTTP 200
15 +
16 +## Windows portable release
17 +Run elease/TreasuryFlow.cmd beside elease/TreasuryFlow-runtime.zip.
18 +The first launch extracts the self-contained Node runtime under %LOCALAPPDATA%/TreasuryFlow/0.1.0 and opens the local TreasuryFlow UI. Bank LIVE mode remains disabled.
19 +
20 +Runtime SHA-256: 1876689ED32986AC579166894A9DA4B6E141022781D055D12B5B196BFE822073
21 +
22 +## External production boundary
23 +Real bank credentials/certification, production PostgreSQL, external IdP/MFA, KMS, WAF/SIEM and live canary remain external provisioning/go-live evidence and are not fabricated by this desktop package.
eslint.config.mjs
+3 -1
@@ -1 +1,3 @@
1 -import {defineConfig} from 'eslint/config'; import nextVitals from 'eslint-config-next/core-web-vitals'; export default defineConfig([...nextVitals]);
1 +import {defineConfig,globalIgnores} from 'eslint/config';
2 +import nextVitals from 'eslint-config-next/core-web-vitals';
3 +export default defineConfig([globalIgnores(['release/**','.next/**','node_modules/**']),...nextVitals]);
src/platform/readiness.test.ts
+2 -1
@@ -1,2 +1,3 @@
1 import {describe,expect,it} from 'vitest';import {readiness} from './readiness';
2 -describe('runtime readiness',()=>{it('is ready in non-production with bank disabled',()=>expect(readiness({NODE_ENV:'test',BANK_ADAPTER_MODE:'disabled'}).ready).toBe(true));it('fails closed in production without required external configuration',()=>{const r=readiness({NODE_ENV:'production',BANK_ADAPTER_MODE:'disabled',APP_BASE_URL:'https://x'});expect(r.ready).toBe(false);expect(r.missing).toEqual(['DATABASE_URL','IDENTITY_PROVIDER','AUTH_PROXY_HMAC_SECRET','KMS_KEY_ID','SIEM_ENDPOINT','WAF_POLICY_ID','ALERT_CHANNEL'])});it('accepts configured production while bank remains disabled',()=>expect(readiness({NODE_ENV:'production',BANK_ADAPTER_MODE:'disabled',APP_BASE_URL:'https://x',DATABASE_URL:'secret-ref',IDENTITY_PROVIDER:'oidc',AUTH_PROXY_HMAC_SECRET:'secret-store-ref',KMS_KEY_ID:'kms',SIEM_ENDPOINT:'siem',WAF_POLICY_ID:'waf',ALERT_CHANNEL:'ops'}).ready).toBe(true));it('never reports ready for live bank mode',()=>expect(readiness({NODE_ENV:'test',BANK_ADAPTER_MODE:'live'}).ready).toBe(false))});
2 +describe('runtime readiness',()=>{it('is ready in non-production with bank disabled',()=>expect(readiness({NODE_ENV:'test',BANK_ADAPTER_MODE:'disabled'}).ready).toBe(true));it('fails closed in production without required external configuration',()=>{const r=readiness({NODE_ENV:'production',BANK_ADAPTER_MODE:'disabled',APP_BASE_URL:'https://x'});expect(r.ready).toBe(false);expect(r.missing).toEqual(['DATABASE_URL','IDENTITY_PROVIDER','AUTH_PROXY_HMAC_SECRET','KMS_KEY_ID','SIEM_ENDPOINT','WAF_POLICY_ID','ALERT_CHANNEL'])});it('accepts configured production while bank remains disabled',()=>expect(readiness({NODE_ENV:'production',BANK_ADAPTER_MODE:'disabled',APP_BASE_URL:'https://x',DATABASE_URL:'secret-ref',IDENTITY_PROVIDER:'oidc',AUTH_PROXY_HMAC_SECRET:'secret-store-ref',KMS_KEY_ID:'kms',SIEM_ENDPOINT:'siem',WAF_POLICY_ID:'waf',ALERT_CHANNEL:'ops'}).ready).toBe(true));it('accepts explicitly local desktop runtime without external production services',()=>expect(readiness({NODE_ENV:'production',TREASURYFLOW_DESKTOP_LOCAL:'1',BANK_ADAPTER_MODE:'disabled'}).ready).toBe(true));it('never reports ready for live bank mode',()=>expect(readiness({NODE_ENV:'test',BANK_ADAPTER_MODE:'live'}).ready).toBe(false))});
3 +
src/platform/readiness.ts
+2 -1
@@ -1 +1,2 @@
1 -const required=['DATABASE_URL','IDENTITY_PROVIDER','AUTH_PROXY_HMAC_SECRET','KMS_KEY_ID','SIEM_ENDPOINT','WAF_POLICY_ID','ALERT_CHANNEL'] as const;export function readiness(env:Record<string,string|undefined>){const missing=env.NODE_ENV==='production'?required.filter(k=>!env[k]||env[k]?.startsWith('__')):[];const unsafeLive=env.BANK_ADAPTER_MODE==='live';return{ready:missing.length===0&&!unsafeLive,missing:[...missing],bankAdapter:env.BANK_ADAPTER_MODE??'disabled'}}
1 +const required=['DATABASE_URL','IDENTITY_PROVIDER','AUTH_PROXY_HMAC_SECRET','KMS_KEY_ID','SIEM_ENDPOINT','WAF_POLICY_ID','ALERT_CHANNEL'] as const;export function readiness(env:Record<string,string|undefined>){const localDesktop=env.TREASURYFLOW_DESKTOP_LOCAL==='1';const missing=env.NODE_ENV==='production'&&!localDesktop?required.filter(k=>!env[k]||env[k]?.startsWith('__')):[];const unsafeLive=env.BANK_ADAPTER_MODE==='live';return{ready:missing.length===0&&!unsafeLive,missing:[...missing],bankAdapter:env.BANK_ADAPTER_MODE??'disabled'}}
2 +