Só formatação automática (pint, vp check --fix), sem alterar comportamento. Excluídos da formatação os registos e artefactos com bytes fixos: docs/, integrations/, storage/, tmp/, output/, resources/data/, tests/Fixtures/, compras-release.json e AGENTS*.md. Scripts operacionais, integrations e auxiliares de teste ficam fora do lint (usam new Function; limpeza na fase 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.7 KiB
JavaScript
38 lines
1.7 KiB
JavaScript
import fs from 'node:fs/promises';
|
|
import assert from 'node:assert/strict';
|
|
const source = await fs.readFile(
|
|
'scripts/supplier-evaluation-check.mjs',
|
|
'utf8',
|
|
);
|
|
const common = source.slice(
|
|
source.indexOf('const base ='),
|
|
source.indexOf('const author ='),
|
|
);
|
|
await new Function(
|
|
'fs',
|
|
'assert',
|
|
'return (async()=>{' +
|
|
common +
|
|
`
|
|
const records=[];
|
|
for(const [role,expected] of [['admin',200],['warehouse',403]]) {
|
|
const viewer=client(); await viewer.enter(role);
|
|
assert.equal((await viewer.request('/contexto','POST',{area:'procurement',option:'procurement.internal'})).status,302);
|
|
const result=await viewer.request('/stock/piloto');assert.equal(result.status,expected);
|
|
if(expected===200) {
|
|
const runtime=result.page.props.report.runtime;
|
|
assert.equal(typeof runtime.schedulerRecent,'boolean');
|
|
assert.equal(runtime.schedulerBound,undefined);
|
|
assert.equal(runtime.recoveryReady,true);
|
|
assert.ok(Number(runtime.work.total)>=0);
|
|
}
|
|
records.push({role,status:result.status});
|
|
}
|
|
await fs.writeFile('docs/proofs/replenishment-health-http.json',JSON.stringify({checked_at:new Date().toISOString(),environment:base,result:'passed',records,
|
|
pilot_health_command_executed:false,business_commands:false,accounts_or_grants_changed:false,sgf_changed:false,visual_review:false,
|
|
coverage:'Existing tenant-scoped diagnostic UI and rights preserved; CLI health executed only in disposable databases.'},null,2));
|
|
console.log('Diagnóstico do piloto conferido em leitura, sem executar reposições.');
|
|
` +
|
|
'})()',
|
|
)(fs, assert);
|