سامانه صدور فاکتور و حسابداری
fix(qa): treat healthy source-linked drafts as informational in preflight
davoodmehraban89 committed
Nov 22, 2026 at 09:49 UTC
a7b74af8af063eb5ce496e1210ec1915db96e59c
2 files changed
+3
-2
scripts/draft-conversion-inventory.test.mjs
+2
-1
@@ -112,13 +112,14 @@ test('existing preflight CLI emits allowlisted source counts and fails closed on
112
return spawnSync(process.execPath,[cmd,path],{encoding:'utf8',timeout:10000});
113
};
114
try{
115
- const clean=run({...empty,sourcesConsidered:3,PRIVATE_SOURCE:'must-never-echo'});
115
+ const clean=run({...empty,sourcesConsidered:3,linkedDraftSources:2,PRIVATE_SOURCE:'must-never-echo'});
116
assert.equal(clean.status,0,clean.stderr);
117
assert.equal(clean.stdout.includes('must-never-echo'),false);
118
const report=JSON.parse(clean.stdout);
119
assert.equal(report.executable,false,'preflight is never authorization to convert');
120
assert.equal(report.sourceIdentityReady,true);
121
assert.equal(report.sourceIdentityAudit.sourcesConsidered,3);
122
+ assert.equal(report.sourceIdentityAudit.linkedDraftSources,2,'valid linked drafts are healthy, not a discrepancy');
123
assert.equal(Object.keys(report.sourceIdentityAudit).length,fields.length);
124
const problem=run({...empty,sourcesConsidered:3,duplicateDraftSourceIdentities:1});
125
assert.equal(problem.status,2,'source draft collision must block readiness');
scripts/draft-conversion-preflight.mjs
+1
-1
@@ -22,7 +22,7 @@ try{
22
}));
23
}
24
const sourceIdentityReady=sourceIdentityAudit!==null &&
25
- sourceCountFields.every(key=>key==='sourcesConsidered'||sourceIdentityAudit[key]===0);
25
+ sourceCountFields.every(key=>['sourcesConsidered','linkedDraftSources'].includes(key)||sourceIdentityAudit[key]===0);
26
console.log(JSON.stringify({
27
snapshotAt:inventory.snapshotAt, journalCount:inventory.journals.length,
28
integrityReady:result.integrityReady, executable:result.executable,