From 2fdca86367d8bad524113b4cf6c49a0110130be9 Mon Sep 17 00:00:00 2001 From: nala Date: Sat, 24 Oct 2026 23:59:51 +0200 Subject: [PATCH] docs(iva): prepare joint P096-P099 delivery after backup and isolated restore --- .../l1-g7-reduced-delivery-20261024.json | 158 ++++++++++++++++++ ...7-reduced-readonly-rollback-20261024.patch | 10 ++ 2 files changed, 168 insertions(+) create mode 100644 docs/investmoz/simulations/l1-g7-reduced-delivery-20261024.json create mode 100644 docs/investmoz/simulations/l1-g7-reduced-readonly-rollback-20261024.patch diff --git a/docs/investmoz/simulations/l1-g7-reduced-delivery-20261024.json b/docs/investmoz/simulations/l1-g7-reduced-delivery-20261024.json new file mode 100644 index 00000000..93c9a52f --- /dev/null +++ b/docs/investmoz/simulations/l1-g7-reduced-delivery-20261024.json @@ -0,0 +1,158 @@ +{ + "status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore", + "candidate": "833b4e5cef4334220fd3f27843d520113e9ba0cd", + "base_installed": "2a7254406db3aa6e8c71bfbaf56bbcda1f139d19", + "coverage_complete_branches": { + "AUD-SIM-L1-P096": [ + "regulated_energy" + ], + "AUD-SIM-L1-P097": [ + "aeronautical_fees" + ], + "AUD-SIM-L1-P098": [ + "public_works" + ], + "AUD-SIM-L1-P099": [ + "public_water" + ] + }, + "branch_count_complete": 4, + "treatment_count": 4, + "runtime_delta": [ + { + "path": "resources/js/lib/iva-reduced-bases.ts", + "sha256_LF": "4fc79388066a4d012b9af279ef53212ee963ae43d858307155e9ae8a140b5285" + }, + { + "path": "resources/js/components/simulation-reduced-bases.tsx", + "sha256_LF": "00f1e0f1490240f578401c3a6e10b6812ee5b7978bbf7d7e5c9c1a81124bc6d1" + }, + { + "path": "resources/js/components/simulation-monthly-iva.tsx", + "sha256_LF": "6032b9605703e7e29d5fb45cc158e8da57b9af4980d312f3326ddf18ee1e8814" + }, + { + "path": "resources/js/lib/project-dossier.ts", + "sha256_LF": "ab044a0952cc4753925768f5ba7fd422637cfb9d826c1e8c26d21d7616b6dacf" + } + ], + "counts_before": { + "delivered": 103, + "QA": 4, + "functional_pending": 25, + "documentary": 1, + "total": 133 + }, + "counts_current": { + "delivered": 103, + "QA": 4, + "functional_pending": 25, + "documentary": 1, + "total": 133 + }, + "counts_after_delivery": { + "delivered": 107, + "QA": 0, + "functional_pending": 25, + "documentary": 1, + "total": 133 + }, + "QA_proofs_reused": [ + "iva-l1-g7-reduced-bases-qa-20261024.json" + ], + "authorization": "Tempo explicitly requests one joint delivery of833b4e5c,P096–P099,main compatibility/concurrent changes preserved,installeddelta only", + "scope": "2026/MZN,base apenas. Percentagens62/85/40/75 são de base,não taxasIVA. Proporção18(6)registada sem calcular/conceder dedução/campo11;dedução permanece nas condições/lotes próprios. Sem taxaIVA,IVA,isenção ou totaisModeloA. Não dividir bruto comIVA sem composição esclarecida,nem reduzir montante já reduzido.", + "source": "CIVA15(2)j/k/l/m,15(1)/(5)/(6)/(9),Lei13/2016PDF13–14/p1426(271–272);Lei22/2022PDF3mantém15(2)j–m;Lei10/2025não altera15,adita18(6),PDF13:dedução do imposto suportado relativo a essas operações na mesma proporção da base reduzida.", + "meaning": { + "P096": { + "treatment": "regulated_energy", + "formula": "contraprestação total antes redução,sempróprioIVA ×62%", + "conditions": "Transmissão de energia com preço fixado porAutoridadePública,referência/âmbito/intervalo aplicáveis." + }, + "P097": { + "treatment": "aeronautical_fees", + "formula": "contraprestação total antes redução,sempróprioIVA ×85%", + "conditions": "Preço doserviço fixado através de taxas aeronáuticas. Não aplicar a comunicações/saneamento/telecomunicações genericamente pelo título histórico da matriz;é necessário demonstrar o preço fixado através de taxa aeronáutica15(2)k." + }, + "P098": { + "treatment": "public_works", + "formula": "contraprestação total antes redução,sempróprioIVA ×40%(redução60%,não base60%)", + "conditions": "Construção/reabilitação de obras públicas abrangidas15(2)l/15(9),projecto/contrato/categoria/âmbito identificados;estradas,pontes,infraestrutura água/saneamento,electrificação rural emprojectos públicos e hidráulicaagrícola noâmbito definido. Não exigir preço regulado a esta alínea." + }, + "P099": { + "treatment": "public_water", + "formula": "contraprestação total antes redução,sempróprioIVA ×75%", + "conditions": "Água potável através derede pública,preço fixado porAutoridadePública comreferência/âmbito/intervalo aplicáveis." + } + }, + "formula": "Base=fullconsideration before reduction excludingownVAT ×branchpercentage once;exactdecimal retained,no fiscalrounding assumed.", + "preservation": "103prior closures and partialP084/P085 preserved;accepted perbranchQA reused;one integration/backup/real isolatedrestore/check for whole set", + "partial_P084_P085": "Preparation/conditional simulation only,benefits pending;no closure", + "limits": "P121digital/P084/P085pending;L1open;P00105/06;beveragesL2/L3;Statistics/AIdeferred", + "containment": "l1-g7-reduced-readonly-rollback-20261024.patch,checked only,not applied;blocks newP096–099classifications,preserves readers/history/otherbranches", + "authenticated_preflight": { + "installed": { + "status": "installed", + "commit": "2a7254406db3aa6e8c71bfbaf56bbcda1f139d19", + "release": "/var/www/investmoz-homologacao/releases/2a7254406db3aa6e8c71bfbaf56bbcda1f139d19-ae306e0a", + "previous_release": "/var/www/investmoz-homologacao/releases/03c26d66139f36573cf58362a5076b4d5f98eca2-ac76aca8", + "database_migrations": 0, + "content_imports": 0 + }, + "current_link": "/var/www/investmoz-homologacao/releases/2a7254406db3aa6e8c71bfbaf56bbcda1f139d19-ae306e0a", + "release_revision": { + "commit": "2a7254406db3aa6e8c71bfbaf56bbcda1f139d19", + "branch": "main", + "built_at": "2026-10-24T21:51:55.419637+00:00", + "manifest_sha256": "a04bb2c3e527c027aa263827b37e1566b67b372c479904112cfef79de9bcf2fb" + }, + "service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n", + "configuration_keys": [ + "repository", + "branch", + "target_url", + "legacy_root", + "state_root", + "release_root", + "current_link", + "shared_assets", + "php", + "schema_contract", + "ci_environment", + "postgis_image", + "test_database", + "qa_port", + "retention", + "webhook_secret_file" + ], + "safe_paths": { + "repository": "nala/Investidor-V2", + "release_root": "/var/www/investmoz-homologacao/releases", + "postgis_image": "postgis/postgis@sha256:01a6a70e41e6c4467c8f55f6063555ed72db2d6662cd0d571040d42eadaeb6f6" + }, + "pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604" + }, + "backup_restore": { + "backup": { + "stage": "/var/backups/investmoz-l1-g7-reduced-delivery-20261024/backup", + "target": { + "database": "teste_investidor", + "port": 5432 + }, + "tables": 174, + "files_verified": 369, + "dump_sha256": "844803edd3a18d94ebd1cc75f942cce73b113111c92342ff32acf178b27f210d", + "files_sha256": "0b8a20760cdb89e2d7ac03e4b00881a882946370b9d7fa5a428355111e5ace4c", + "restore_verified": false + }, + "restore": { + "restore_verified": true, + "tables_verified": 174, + "container_network": "none", + "database": "l1_g7_reduced_restore_20261024", + "port": 55441, + "source_dump_sha256": "844803edd3a18d94ebd1cc75f942cce73b113111c92342ff32acf178b27f210d", + "active_database_writes": 0 + } + } +} diff --git a/docs/investmoz/simulations/l1-g7-reduced-readonly-rollback-20261024.patch b/docs/investmoz/simulations/l1-g7-reduced-readonly-rollback-20261024.patch new file mode 100644 index 00000000..796c832e --- /dev/null +++ b/docs/investmoz/simulations/l1-g7-reduced-readonly-rollback-20261024.patch @@ -0,0 +1,10 @@ +--- a/resources/js/lib/iva-reduced-bases.ts ++++ b/resources/js/lib/iva-reduced-bases.ts +@@ -53,6 +53,7 @@ + function key(draft:Record,book:ReducedBaseBook):string{return JSON.stringify({version:reducedBaseVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},currency:draft.currency,rows:book.rows});} + export function reducedBaseCurrent(draft:Record,book:ReducedBaseBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);} + export function recordReducedBases(draft:Record,book:ReducedBaseBook):ReducedBaseBook{ ++ throw new Error('Novas classificações P096–P099 temporariamente suspensas; dados, histórico, relatórios e restantes ramos preservados.'); + if(!book.rows.length||new Set(book.rows.map(row=>row.id)).size!==book.rows.length)throw new Error('Indique operações com identificadores distintos;originais conservados.'); + const result:ReducedBaseCalculation={version:reducedBaseVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:reducedBaseSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateReducedBase(row,draft.currency))}; + const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveReducedBaseBook(draft,next);return next;