فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
fix(ci): unblock A08 stability and gate expensive endurance
Davood Mehraban committed
Nov 24, 2026 at 17:06 UTC
c61c4ffee816a966a04046c4b5bf6d9b91c4cd8d
6 files changed
+150
-36
.github/workflows/a08-installed-memory-stability.yml
+40
-2
@@ -1,12 +1,14 @@
1
-أ¯آ»طںname: A08 installed Windows memory stability (reuse NSIS)
1
+name: A08 installed Windows memory stability (reuse NSIS)
2
on:
3
push:
4
branches: [work/a08-memory-stability-20261123]
5
paths:
6
- '.github/workflows/a08-installed-memory-stability.yml'
7
- 'tests/windows-vm-native-memory-stability-browser.js'
8
+ - 'tests/windows-vm-native-memory-stability-contract.test.mjs'
9
- 'tests/windows-vm-installed-tauri-cdp.cjs'
10
- 'scripts/windows-vm-targeted-a08.ps1'
11
+ - 'scripts/lint-workflows.sh'
12
workflow_dispatch:
13
inputs:
14
artifact_run_id:
@@ -21,14 +23,40 @@ on:
23
description: 'Candidate installer version from that run'
24
required: true
25
type: string
26
+ run_endurance:
27
+ description: 'Also run the 120-minute endurance test after the ten-cycle smoke'
28
+ required: false
29
+ type: boolean
30
+ default: false
31
permissions:
32
contents: read
33
actions: read
34
+concurrency:
35
+ group: a08-memory-${{ github.ref }}-${{ github.event_name }}
36
+ cancel-in-progress: ${{ github.event_name == 'push' }}
37
jobs:
38
+ preflight:
39
+ name: Validate workflows and browser-cycle regression before Windows
40
+ runs-on: ubuntu-latest
41
+ timeout-minutes: 10
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ with:
45
+ persist-credentials: false
46
+ - name: Validate GitHub Actions schema and expressions
47
+ run: bash scripts/lint-workflows.sh
48
+ - uses: actions/setup-node@v4
49
+ with:
50
+ node-version: '22'
51
+ - name: Exercise browser-cycle success and rejection paths
52
+ run: node --test tests/windows-vm-native-memory-stability-contract.test.mjs
53
+ - name: Parse native harness before starting Windows
54
+ run: node --check tests/windows-vm-installed-tauri-cdp.cjs
55
targeted-native-a08:
56
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/work/a08-memory-stability-20261123'
57
+ needs: preflight
58
runs-on: windows-latest
31
- timeout-minutes: 160
59
+ timeout-minutes: ${{ github.event_name == 'workflow_dispatch' && inputs.run_endurance && 160 || 25 }}
60
steps:
61
# Checkout the separately reviewed QA harness; verify the immutable
62
# binary-producing source SHA independently against its successful run.
@@ -74,6 +102,7 @@ jobs:
102
if ($files.Count -ne 1) { throw 'Expected exactly one reused NSIS installer' }
103
./scripts/windows-vm-targeted-a08.ps1 -Installer $files[0].FullName -ExpectedVersion $env:EXPECTED_VERSION -Mode stability
104
- name: Run 120-minute installed endurance after short smoke
105
+ if: github.event_name == 'workflow_dispatch' && inputs.run_endurance
106
shell: pwsh
107
env:
108
A08_ENDURANCE: '1'
@@ -93,3 +122,12 @@ jobs:
122
${{ runner.temp }}/factor-a08-targeted-native-smoke/reports/*.json
123
retention-days: 14
124
if-no-files-found: warn
125
+ - name: State actual acceptance scope
126
+ if: always()
127
+ shell: pwsh
128
+ env:
129
+ ENDURANCE_REQUESTED: ${{ github.event_name == 'workflow_dispatch' && inputs.run_endurance }}
130
+ run: |
131
+ "Harness checkout: $(git rev-parse HEAD)" >> $env:GITHUB_STEP_SUMMARY
132
+ "120-minute endurance requested: $env:ENDURANCE_REQUESTED" >> $env:GITHUB_STEP_SUMMARY
133
+ "A ten-cycle smoke is not a 120-minute acceptance or a memory-leak verdict. Consult the recorded step results and JSON evidence." >> $env:GITHUB_STEP_SUMMARY
.github/workflows/pr-quality-gates.yml
+2
@@ -26,6 +26,8 @@ jobs:
26
uses: actions/checkout@v4
27
with:
28
persist-credentials: false
29
+ - name: Validate GitHub Actions schema and expressions
30
+ run: bash scripts/lint-workflows.sh
31
- name: Install Node.js
32
uses: actions/setup-node@v4
33
with:
PROJECT_STATUS.md
+29
-4
@@ -1,4 +1,29 @@
1
-## RESUME_PACKET — verified independent A08 result (2026-11-23)
1
+## RESUME_PACKET — A08 workflow recovery (2026-11-24)
2
+
3
+- schema_version: 2; updated_at_utc: 2026-11-24T13:35:52+00:00; session_id: finora-a08-workflow-recovery-20261124.
4
+- active_goal / task: Issue #201, repair the stalled installed-memory QA workflow without rebuilding product installers or merging product code.
5
+- repository: davoodmehraban89/Factor-easyPro; active Draft PR: #202; branch: work/a08-memory-stability-20261123; parent Draft PR: #199.
6
+- worktree_path: C:\Users\Davood\Documents\Factor-easyPro-QA\.worktrees\factor-a08-memory-stability-20261123.
7
+- baseline_commit: 93bec56498e115c653da153e00a19f02efc57159; clean local and remote state verified before this change. Current implementation SHA is the Git commit containing this packet.
8
+- last_completed_action: reproduced the invalid workflow with actionlint 1.7.7; repaired the malformed UTF-8 prefix before the name key; added checksum-pinned Actions validation to normal PR quality and the memory preflight; made the browser regression discoverable by npm test.
9
+- failure_ledger: runs 45343458191 and 45343858906 failed before any jobs. The key was corrupted to a nonstandard name by an encoding conversion. They are workflow-definition failures, not Windows installation failures or a product memory-leak result. Two occurrences; resolved locally by parser validation, remote verification still pending.
10
+- change_scope: CI/harness tests and execution status only. No application, schema, Holoo, native binary or package dependency changes.
11
+- test_policy: pushes run preflight then the ten-cycle installed smoke using the existing NSIS. Endurance requires workflow_dispatch with run_endurance=true; default false. Separate timeout budgets are 25 and 160 minutes. A short pass never means 120-minute acceptance.
12
+- verification: Linux npm test 488/488 pass, 0 failed/skipped; Vite build pass (existing large-chunk advisory); production dependency audit 0 advisories; actionlint across workflows pass; five browser-harness positive/negative tests pass. These are local results, not a claim of native Windows success for this revision.
13
+- prior_installed_evidence: https://github.com/davoodmehraban89/Factor-easyPro/actions/runs/45248855137 succeeded at 369ba0b with 10 cycles and actual Windows process-tree metrics. Post-GC renderer heap was 4,094,320 B in cycle 1 and 4,153,060 B in cycle 10. This is one short sample, not a leak verdict or long-duration acceptance.
14
+- artifact_source: existing successful native run 45243530762, product source 25faa1548536572d4a2199fe9c11fea9c1029b6f, candidate 2.0.4. Harness revisions are recorded separately; do not rebuild NSIS merely for these QA edits.
15
+- delivery_state: local changes under validation; commit/push and current CI not yet claimed.
16
+- interrupted_action: none; unpublished_work: this recovery patch until pushed.
17
+- next_action: run the five harness tests on Aram, commit/push the focused patch on #202, then inspect its quality and targeted Windows runs. Update this packet and PR body with the actual outcome; do not rerun while an equivalent run is active.
18
+- blockers / limits: the memory workflow is absent from main as checked on 2026-11-24, so workflow_dispatch activation still requires a separately authorized workflow integration. The 120-minute test and >=3 independent runner samples required by #201 remain unverified. Physical QA and release gates remain separate.
19
+- approvals: safe branch edits, tests, commit/push and Draft PR maintenance are authorized. No new merge, release, production installation or SQL write authorization. Historical approval for #200 does not authorize #202/#199 merge.
20
+- do_not_repeat: no rerun of the two malformed workflow revisions; no NSIS rebuild for harness-only changes; no automatic two-hour workload per push; no reinterpretation of short smoke as endurance; no retry of historical A08 fixed-date failures.
21
+- security_gates: synthetic isolated CI allowed; Phase A public release and operational Holoo writes remain NO-GO.
22
+- All sections below are historical evidence, not additional active resume packets.
23
+
24
+---
25
+
26
+## Historical checkpoint — verified independent A08 result (2026-11-23)
27
28
- User approved ONLY PR #200 merge; merged to main as e4f9b020f50ba617db7f4a9fdd5eadc8fb6f0fa2. Product PR #199 remains Draft, unmerged.
29
- Independent A08 run 45242810197: COMPLETED SUCCESS. Native installed WebView2 benchmark step and evidence upload SUCCESS.
@@ -13,7 +38,7 @@
38
39
---
40
16
-## RESUME_PACKET — A08 activation and dispatch checkpoint (2026-11-23)
41
+## Historical checkpoint — A08 activation and dispatch checkpoint (2026-11-23)
42
43
- User approved merging ONLY PR #200; no product merge, release or production writes.
44
- PR #200 merged via squash to main: e4f9b020f50ba617db7f4a9fdd5eadc8fb6f0fa2; workflow ID 428175137 registered.
@@ -26,7 +51,7 @@
51
52
---
53
29
-## RESUME_PACKET — current verified checkpoint (2026-11-23)
54
+## Historical checkpoint — current verified checkpoint (2026-11-23)
55
56
- Repo: davoodmehraban89/Factor-easyPro; product: offline Persian Tauri 2 / IndexedDB, NOT web/multiuser ERP.
57
- Phase A: **NO-GO**; independent physical and release acceptance remain open. Phases A-E percentages are NOT measured; Phase F release not authorized.
@@ -42,7 +67,7 @@
67
- Prior checkpoint below is historical and superseded for active execution status.
68
69
---
45
-## RESUME_PACKET — active execution checkpoint
70
+## Historical checkpoint — active execution checkpoint
71
72
- schema_version: 1
73
- updated_at_utc: 2026-11-23 (UTC clock precision not verified)
scripts/lint-workflows.sh
new
+16
@@ -0,0 +1,16 @@
1
+#!/usr/bin/env bash
2
+# Validate GitHub's workflow structure, not only YAML syntax. Disposable Linux CI.
3
+set -euo pipefail
4
+
5
+version=1.7.7
6
+archive_sha256=023070a287cd8cccd71515fedc843f1985bf96c436b7effaecce67290e7e0757
7
+lint_dir=$(mktemp -d)
8
+trap 'rm -rf "$lint_dir"' EXIT
9
+curl --fail --silent --show-error --location \
10
+ "https://github.com/rhysd/actionlint/releases/download/v${version}/actionlint_${version}_linux_amd64.tar.gz" \
11
+ --output "$lint_dir/actionlint.tar.gz"
12
+printf '%s %s\n' "$archive_sha256" "$lint_dir/actionlint.tar.gz" | sha256sum --check --status
13
+tar -xzf "$lint_dir/actionlint.tar.gz" -C "$lint_dir" actionlint
14
+# PowerShell steps are parsed by the Windows jobs. These optional Python/shell
15
+# linters are not required for the Actions schema/expression validation gate.
16
+"$lint_dir/actionlint" -shellcheck= -pyflakes= "$@"
tests/windows-vm-native-memory-stability-contract.test.cjs
deleted
-30
@@ -1,30 +0,0 @@
1
-'use strict';
2
-const { test } = require('node:test');
3
-const assert = require('node:assert/strict');
4
-const fs = require('node:fs');
5
-const vm = require('node:vm');
6
-const path = require('node:path');
7
-
8
-test('native stability script is browser-compatible and checks 10k/50k cycles', async () => {
9
- const source = fs.readFileSync(path.join(__dirname,
10
- 'windows-vm-native-memory-stability-browser.js'), 'utf8');
11
- assert.doesNotMatch(source, /\brequire\s*\(/);
12
- assert.doesNotMatch(source, /\bprocess\./);
13
- const store = {
14
- count: async name => ({ products: 10000, invoices: 50000 })[name],
15
- getByCompany: async () => Array(50000).fill(null)
16
- };
17
- const region = { querySelectorAll: () => Array(100).fill(null) };
18
- const context = {
19
- FINORA: { Storage: store, Company: { current: async () => ({ id: 'synthetic' }) },
20
- Router: { go: async () => {} } },
21
- __TAURI_INTERNALS__: { invoke: () => {} },
22
- window: { ReportsView: { _switchTab: () => {}, _setProductsPage: () => {} } },
23
- document: { getElementById: () => region },
24
- performance: { now: () => 1 }
25
- };
26
- const result = await vm.runInNewContext(source, context, { timeout: 3000 });
27
- assert.equal(result.rounds.length, 1);
28
- assert.equal(result.products, 10000);
29
- assert.equal(result.invoices, 50000);
30
-});
tests/windows-vm-native-memory-stability-contract.test.mjs
new
+63
@@ -0,0 +1,63 @@
1
+import test from 'node:test';
2
+import assert from 'node:assert/strict';
3
+import { readFileSync } from 'node:fs';
4
+import vm from 'node:vm';
5
+
6
+// .test.mjs is intentional: the normal npm test command discovers this file.
7
+const source = readFileSync(new URL('./windows-vm-native-memory-stability-browser.js', import.meta.url), 'utf8');
8
+
9
+function harness({ products = 10000, companyInvoices = 50000, invalidPage, mutateAfterRead = false } = {}) {
10
+ const visited = [];
11
+ let page;
12
+ let read = false;
13
+ const context = {
14
+ FINORA: {
15
+ Storage: {
16
+ count: async name => name === 'products' ? products : (read && mutateAfterRead ? 49999 : 50000),
17
+ getByCompany: async () => { read = true; return Array(companyInvoices).fill(null); }
18
+ },
19
+ Company: { current: async () => ({ id: 'synthetic' }) },
20
+ Router: { go: async () => {} }
21
+ },
22
+ __TAURI_INTERNALS__: { invoke: () => {} },
23
+ window: { ReportsView: {
24
+ _switchTab: () => {},
25
+ _setProductsPage: value => { page = value; visited.push(value); }
26
+ } },
27
+ document: { getElementById: () => ({
28
+ querySelectorAll: () => Array(page === invalidPage ? 99 : 100).fill(null)
29
+ }) },
30
+ performance: { now: () => 1 }
31
+ };
32
+ return { visited, run: () => vm.runInNewContext(source, context, { timeout: 3000 }) };
33
+}
34
+
35
+test('native stability cycle runs in a browser-only context and checks first/middle/last pages', async () => {
36
+ const h = harness(); // No Node require or process exists inside this context.
37
+ const result = await h.run();
38
+ assert.equal(result.rounds.length, 1);
39
+ assert.equal(result.products, 10000);
40
+ assert.equal(result.invoices, 50000);
41
+ assert.equal(result.companyInvoices, 50000);
42
+ assert.deepEqual(h.visited, [1, 50, 100]);
43
+});
44
+
45
+test('native stability rejects a missing 10k-product fixture before navigating', async () => {
46
+ const h = harness({ products: 9999 });
47
+ await assert.rejects(h.run(), /exact synthetic A08 dataset/);
48
+ assert.deepEqual(h.visited, []);
49
+});
50
+
51
+test('native stability rejects invoices missing from the selected company', async () => {
52
+ await assert.rejects(harness({ companyInvoices: 49999 }).run(), /Company invoice count changed/);
53
+});
54
+
55
+test('native stability fails at the actual incorrect middle page', async () => {
56
+ const h = harness({ invalidPage: 50 });
57
+ await assert.rejects(h.run(), /pagination failed at page 50/);
58
+ assert.deepEqual(h.visited, [1, 50]);
59
+});
60
+
61
+test('native stability rejects record-count changes after navigation', async () => {
62
+ await assert.rejects(harness({ mutateAfterRead: true }).run(), /Synthetic record counts changed/);
63
+});