import fs from 'node:fs';import assert from 'node:assert/strict';import {session} from './sgf-single-http.mjs'; const run=JSON.parse(fs.readFileSync('C:/laragon/data/sgf-tempo/run/modular-regression-current.json')),root=run.root+'/private/receipt-composition-cc50a276c10c';const plan=JSON.parse(fs.readFileSync(root+'/single-financial-http-progress.json'));const checks=[];const ok=(v,n)=>{assert(v,n);checks.push(n);}; const finance=await session('sgf:finance_prepare','finance'),ledger=await session('sgf:accounting_prepare','accounting'),reader=await session('sgf:read_only','accounting'); let r=await finance.get('/api/finance/payables/payment-prepare',{method:'POST',headers:{'Content-Type':'application/json'},body:'{}'});ok(r.status===419,'authenticated financial write without CSRF419'); r=await ledger.get('/api/general-ledger',{headers:{'X-SGF-Context':'changed-generation'}});ok(r.status===409,'stale context generation409'); r=await finance.get('/api/general-ledger');ok(r.status===409,'financial session cannot silently cross into accounting'); let command=plan.operations.payment20;r=await finance.command(command.path,command.body,command.key);ok(r.status===200&&r.value.payment_id===command.result.payment_id,'HTTP financial receipt recovers original payment without duplicating it'); r=await finance.command(command.path,{...command.body,reason:'Changed content must not reuse this key.'},command.key);ok(r.status===409,'financial operation key bound to exact content'); command=plan.operations['sale1000-post'];r=await ledger.command(command.path,command.body,command.key);ok(r.status===200&&r.value.journal_id===command.result.journal_id,'HTTP journal recovery returns the original sales journal'); r=await reader.command('/api/general-ledger/post',command.body);ok(r.status===403,'read-only accountant cannot borrow the native legacy posting identity'); r=await finance.get('/api/finance/payables?payment_per_page=100&payments_page=1&allocation_proposals_page=1&allocations_page=1&payment_events_page=1&payment_state=confirmed');ok(r.status===200,'bounded independent financial pages100 remain available with state filter');const data=await r.json();ok(Object.values(data.money.pagination).every(p=>p.per_page===100),'all four financial result groups use requested server page size'); r=await finance.get('/api/finance/payables?unrecognised_scope=3');ok(r.status===422,'unknown query scope cannot change financial partition'); const result=root+'/single-boundaries-http-20261110.json';fs.writeFileSync(result,JSON.stringify({passed:true,checks,new_business_effects:0,browser_visual_review:false},null,2));console.log(JSON.stringify({passed:true,checks:checks.length,proof:result}));