Files
SGF/scripts/summarize-sgf-six-modules.mjs
2026-11-11 09:00:17 +02:00

12 lines
5.8 KiB
JavaScript

import fs from'node:fs';import path from'node:path';import crypto from'node:crypto';import assert from'node:assert/strict';
const run=JSON.parse(fs.readFileSync('C:/laragon/data/sgf-tempo/run/modular-regression-current.json'));assert.equal(run.id,'2576427d1939');const selected=run.root+'/private/receipt-composition-cc50a276c10c',regression=run.root+'/private/receipt-composition-b4093c6f6707',sha=file=>crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex');
const latest=(root,name)=>fs.readdirSync(root+'/single-integration').filter(d=>fs.existsSync(root+'/single-integration/'+d+'/'+name)).sort().map(d=>root+'/single-integration/'+d+'/'+name).at(-1);
const inputs={guided_menu_http:selected+'/guided-menu-http-20261110.json',module_dropdown_render:selected+'/module-dropdown-render-20261110.json',
workshop_physical_bridge:latest(regression,'workshop-stock-bridge-result.json'),workshop_client:regression+'/single-workshop-stock-client-20261110.json',workshop_commercial:latest(regression,'workshop-commercial-result.json'),accounting_continuity:selected+'/accounting-continuity-http-20261110.json',
stock_protocol:latest(regression,'stock-final-result.json'),stock_concurrency:regression+'/stock-final-concurrency-20261110/result.json',stock_transit_accounting:latest(regression,'stock-transit-ledger-result.json'),stock_recovery:latest(selected,'stock-final-recovery-result.json'),stock_preservation:latest(selected,'stock-final-preservation-result.json'),stock_http:selected+'/single-stock-final-http-progress.json',stock_http_boundaries:selected+'/stock-final-boundaries-http-20261110.json',stock_dom_http:selected+'/stock-final-dom-http-20261110.json',current_period:latest(selected,'period-composition-result.json'),previous_server_restart:selected+'/single-restart-proof-20261110.json',workshop_physical_http:selected+'/single-stock-http-progress.json',workshop_commercial_http:selected+'/single-workshop-commercial-http-progress.json'};
const proofs={};for(const[name,file]of Object.entries(inputs)){assert(file&&fs.existsSync(file),name);const data=JSON.parse(fs.readFileSync(file));assert.equal(data.passed,true,name);proofs[name]={file:file.replaceAll('\\','/'),sha256:sha(file),checks:Array.isArray(data.checks)?data.checks.length:(typeof data.checks==='number'?data.checks:null),reused_from_existing_valid_evidence:['workshop_physical_bridge','workshop_client','workshop_commercial','accounting_continuity','previous_server_restart','workshop_physical_http','workshop_commercial_http'].includes(name)};}
assert.equal(JSON.parse(fs.readFileSync(inputs.stock_protocol)).checks.length,27);assert.equal(JSON.parse(fs.readFileSync(inputs.current_period)).journals,18);assert.equal(JSON.parse(fs.readFileSync(inputs.stock_http)).journals,18);
const sources=['app/Shared/Installation/PresentationEntry.php','resources/views/sgf-presentation-entry.blade.php','resources/js/app.jsx','resources/js/presentation-landing.js','public/sgf-entry-menu.mjs','resources/css/tempo-theme.css','app/Modules/Inventory/StockFinalController.php','app/Modules/Purchasing/ReceiptRuntime.php','app/Modules/Identity/Services/IdentityWorkflow.php','app/Shared/Context/ModuleNavigation.php','app/Modules/Accounting/ComposedLedgerCandidates.php','packages/general-ledger/src/StockValuation.php','packages/general-ledger/src/StockTransitEvidence.php','packages/general-ledger/src/PayableJournal.php','packages/general-ledger/src/LedgerCycle.php','public/sgf-stock-final.mjs','resources/views/stock-final-workspace.blade.php','resources/js/StockMenuWorkspace.jsx','resources/js/ModuleNavigation.jsx','resources/js/WorkshopMenuWorkspace.jsx'].map(file=>({file,sha256:sha(file)}));
const contract='docs/integration/sgf-solution-contract.json',output={date:'2026-11-10',passed:true,meaning:'functional QA review; not presumed owner acceptance or deployment validation',installation:'cc50a276c10c',entry:'http://127.0.0.1:8085/sgf',port:8085,contract_sha256:sha(contract),sgc_required:false,new_demo:false,required_module_flows_executed_in_same_installation:['commercial','purchasing','stock','workshop','finance','accounting'],journals:18,previous_journals_preserved:16,qa_accounts:15,stock_value_minor:14500,period_facts:18,period_pending:0,period_open_after_rolled_back_closure:true,proofs,sources,client_recovery_execution:{script:'scripts/sgf-stock-final-client-check.mjs',source_sha256:sha('scripts/sgf-stock-final-client-check.mjs'),observed_passed_checks:9,evidence:'structured passed:true result observed during this delivery; no visual claim'},stock_visual_review:{confirmed_by:'utilizador',response:'Abre e está legível',automated_browser_review:false,scope:'new Stock transit/lots/history screen only'},other_visual_review:'pending; user confirmed access restored, not complete visual acceptance',navigation:'six horizontal module dropdowns with scoped functions; explicit context selection; no new rights',owner_acceptance_presumed:false,client_presentable:false,deployment_capacity_validated:false,operational_limits:['Sustained load not validated','Cold start of shared PostgreSQL/operating system not executed','Attachments retention/quotas and general orphan reconciliation not validated','Accounts/documents/payments remain synthetic','Optional catalogue features outside fixed mandatory matrix remain explicitly unavailable'],preservation:{existing_client_and_draft_records_compared_unchanged:true,protected_six_associations_unchanged:true,other_protected_databases_connected:false,original_purchasing_binding_unchanged:true,frozen_purchasing_bundle_changed:false,cache_cleared:false,public_rights_changed:false,new_postgresql_roles:false,publication:false,checkpoint:false}};
const file='docs/proofs/sgf-six-module-functional-review-20261110.json';fs.writeFileSync(file,JSON.stringify(output,null,2)+'\n');console.log(JSON.stringify({passed:true,proofs:Object.keys(proofs).length,modules:6,journals:18,client_presentable:false,file}));