9 lines
5.0 KiB
JavaScript
9 lines
5.0 KiB
JavaScript
import fs from 'node:fs';import path from 'node:path';import crypto from 'node:crypto';import assert from 'node:assert/strict';
|
|
const tag=process.argv[2];assert(/^[a-f0-9]{12}$/.test(tag??''));const run=JSON.parse(fs.readFileSync('C:/laragon/data/sgf-tempo/run/modular-regression-current.json')),root=path.join(run.root,'private/receipt-composition-'+tag),prior=path.join(run.root,'private/receipt-composition-9ec0a8e493ea'),read=p=>JSON.parse(fs.readFileSync(p,'utf8')),hash=p=>crypto.createHash('sha256').update(fs.readFileSync(p)).digest('hex'),tests={};
|
|
for(const [name,file,count]of [['ui','obligation-evidence-ui.json',20],['demo','obligation-evidence-demo.json',6]]){const p=path.join(root,file),r=read(p);assert(r.passed);assert.equal(r.checks.length,count);tests[name]={file:'private/'+path.basename(root)+'/'+file,sha256:hash(p),checks:count,result:r};}
|
|
const files=['public/obligation-evidence.mjs','public/supplier-obligation-workspace.mjs','config/receipt_qa.php','resources/views/supplier-obligation-workspace.blade.php'];for(const file of files)assert.equal(hash(file),hash(path.join(root,'app',file)),file);const authority=['app/Modules/Purchasing/ObligationController.php','app/Modules/Purchasing/ReceiptRuntime.php','packages/payables/src/Payables.php'];for(const file of authority){assert.equal(hash(file),hash(path.join(prior,'app',file)));assert.equal(hash(file),hash(path.join(root,'app',file)));}
|
|
const old=fs.readFileSync(path.join(prior,'app/public/supplier-obligation-workspace.mjs'),'utf8'),now=fs.readFileSync('public/supplier-obligation-workspace.mjs','utf8'),legacy=text=>{const start=text.indexOf('for(const p of d.proposals){'),end=text.indexOf('}catch(e){if(own===turn)status.textContent=e.message;}}',start);assert(start>=0&&end>start);return text.slice(start,end);};assert.equal(legacy(now).slice(0,-1),legacy(old));
|
|
const pins={};for(const dir of ['bundle','economic','internal']){pins[dir]=hash(path.join(root,dir,'manifest.json'));for(const [file,h]of Object.entries(read(path.join(root,dir,'manifest.json')).files))assert.equal(hash(path.join(root,dir,file)),h);}assert.deepEqual(pins,read('docs/proofs/invoice-matching-progress-20261103.json').pinned_native_manifests);
|
|
const previous=['docs/proofs/invoice-matching-progress-20261103.json','docs/proofs/supplier-obligation-composition-20261103.json','docs/proofs/module-association-consolidation-summary-20261102.json'].map(file=>({file,sha256:hash(file)})),assoc=read(previous.at(-1).file);assert.equal(read(previous[1].file).checks,72);assert.equal(hash('app/Modules/Identity/Services/ModuleAssociationReview.php'),assoc.source_sha256);assert.equal(hash('app/Modules/Identity/Http/ModuleRecordsController.php'),assoc.controller_sha256);assert.equal(hash('packages/purchasing/current.json'),read(previous[0].file).preservation.installed_purchasing_sha256);
|
|
const out='docs/proofs/obligation-evidence-workspace-20261103.json';assert(!fs.existsSync(out));fs.writeFileSync(out,JSON.stringify({date:new Date().toISOString(),increment:'SGF-OBLIGATION-EVIDENCE-WORKSPACE-QA-v1',passed:true,functional_code:true,checks:26,tests,sources:files.map(file=>({file,sha256:hash(file)})),unchanged_authority:authority.map(file=>({file,sha256:hash(file)})),pinned_native_manifests:pins,behaviour:{explicit_proposal_selection:true,reason_and_preview_survive_evidence_pagination:true,source_or_permission_change_requires_refresh:true,late_preview_cannot_reactivate_stale_form:true,temporary_read_failure_preserves_form:true,in_flight_decision_prevents_selection_switch:true,original_legacy_evidence_branch_preserved:true},demo:{port:8082,entry:'http://127.0.0.1:8082/qa/enter/issuer?open=1',initial_main_requests:0,initial_proposals:0,initial_obligations:0},reused_native_proof:{file:previous[1].file,checks:72,repeated:false},prior_proofs_preserved:previous,preservation:{installed_purchasing_sha256:hash('packages/purchasing/current.json'),new_right_names:[],target_database_connected:false,protected_six_records_changed:false,blocked_cache_cleared:false,previous_demo_data_written:false,public_rights_changed:false,publication:false,checkpoint:false},limitations:['Decision persistence and stale-response tests use simulated DOM/API responses. No new real financial confirmation is claimed.','Native preparation/recognition/idempotency/authority proof is reused with unchanged controller/runtime/kernel;72 prior checks are not included in the26 new checks.','Source refresh is explicit and starts new conferences; choosing another proposal intentionally replaces the selected decision form.','Source/permission checks in the interface use newly observed revision/actor/permission values. The native confirmation remains authoritative for complete current context and source revalidation.','The legacy display remains when the flag is disabled. No new pagination protocol or backend load optimisation is introduced.','Visual review, accessibility, sustained load, installation and deployment capacity remain pending.'],visual_review_pending:true,deployment_capacity_validated:false},null,2)+'\n');console.log(JSON.stringify({output:out,checks:26,demo_port:8082}));
|