riskvalidation 0.8.0__tar.gz → 0.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. {riskvalidation-0.8.0/src/riskvalidation.egg-info → riskvalidation-0.9.0}/PKG-INFO +2 -2
  2. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/README.md +1 -1
  3. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/pyproject.toml +1 -1
  4. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/__init__.py +1 -1
  5. riskvalidation-0.9.0/src/riskvalidation/governance/__init__.py +16 -0
  6. riskvalidation-0.9.0/src/riskvalidation/governance/appetite.py +268 -0
  7. riskvalidation-0.9.0/src/riskvalidation/governance/conventions.py +161 -0
  8. riskvalidation-0.9.0/src/riskvalidation/governance/findings.py +237 -0
  9. riskvalidation-0.9.0/src/riskvalidation/governance/inventory.py +315 -0
  10. riskvalidation-0.9.0/src/riskvalidation/governance/lifecycle.py +42 -0
  11. riskvalidation-0.9.0/src/riskvalidation/governance/opinion.py +67 -0
  12. riskvalidation-0.9.0/src/riskvalidation/governance/policy.py +114 -0
  13. riskvalidation-0.9.0/src/riskvalidation/governance/report.py +673 -0
  14. riskvalidation-0.9.0/src/riskvalidation/governance/schedule.py +55 -0
  15. riskvalidation-0.9.0/src/riskvalidation/governance/scope.py +85 -0
  16. riskvalidation-0.9.0/src/riskvalidation/governance/tiering.py +129 -0
  17. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/policies/default.json +30 -0
  18. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/__init__.py +2 -0
  19. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/fairness.py +2 -1
  20. riskvalidation-0.9.0/src/riskvalidation/validation/governance.py +505 -0
  21. {riskvalidation-0.8.0 → riskvalidation-0.9.0/src/riskvalidation.egg-info}/PKG-INFO +2 -2
  22. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation.egg-info/SOURCES.txt +13 -0
  23. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_registry_complete.py +9 -3
  24. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/LICENSE +0 -0
  25. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/setup.cfg +0 -0
  26. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/aggregation/__init__.py +0 -0
  27. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/aggregation/band.py +0 -0
  28. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/aggregation/bounds.py +0 -0
  29. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/aggregation/copulas.py +0 -0
  30. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/aggregation/model_risk.py +0 -0
  31. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/aggregation/simple.py +0 -0
  32. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ccr/__init__.py +0 -0
  33. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ccr/collateral.py +0 -0
  34. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ccr/cva.py +0 -0
  35. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ccr/exposure.py +0 -0
  36. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ccr/hw1f.py +0 -0
  37. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ccr/swaps.py +0 -0
  38. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/core/__init__.py +0 -0
  39. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/core/build.py +0 -0
  40. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/core/hashing.py +0 -0
  41. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/core/policy.py +0 -0
  42. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/core/registry.py +0 -0
  43. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/core/result.py +0 -0
  44. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/core/suite.py +0 -0
  45. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/engines/__init__.py +0 -0
  46. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/engines/low_default.py +0 -0
  47. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/engines/pd_curve.py +0 -0
  48. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/engines/vasicek.py +0 -0
  49. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/fairness/__init__.py +0 -0
  50. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/fairness/_checks.py +0 -0
  51. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/fairness/conditional.py +0 -0
  52. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/fairness/inference.py +0 -0
  53. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/fairness/metrics.py +0 -0
  54. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/fairness/plants.py +0 -0
  55. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/fairness/policy.py +0 -0
  56. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/fairness/replication.py +0 -0
  57. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/fairness/situation.py +0 -0
  58. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/generators/__init__.py +0 -0
  59. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/generators/_base.py +0 -0
  60. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/generators/counts.py +0 -0
  61. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/generators/drift.py +0 -0
  62. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/generators/framingham.py +0 -0
  63. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/generators/paths.py +0 -0
  64. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/generators/ratings.py +0 -0
  65. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/generators/scores.py +0 -0
  66. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/harness/__init__.py +0 -0
  67. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/harness/exact.py +0 -0
  68. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/harness/performance.py +0 -0
  69. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/harness/rates.py +0 -0
  70. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/harness/run.py +0 -0
  71. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/irrbb/__init__.py +0 -0
  72. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/irrbb/behavioural.py +0 -0
  73. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/irrbb/curves.py +0 -0
  74. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/irrbb/eve_nii.py +0 -0
  75. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/irrbb/shocks.py +0 -0
  76. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/irrbb/simulation.py +0 -0
  77. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/irrbb/slotting.py +0 -0
  78. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/lgd_ead/__init__.py +0 -0
  79. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/lgd_ead/_checks.py +0 -0
  80. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/lgd_ead/ccf.py +0 -0
  81. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/lgd_ead/downturn.py +0 -0
  82. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/lgd_ead/floors.py +0 -0
  83. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/lgd_ead/lgd_models.py +0 -0
  84. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/lgd_ead/workout.py +0 -0
  85. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/liquidity/__init__.py +0 -0
  86. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/liquidity/_checks.py +0 -0
  87. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/liquidity/cbc.py +0 -0
  88. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/liquidity/deposits.py +0 -0
  89. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/liquidity/ladder.py +0 -0
  90. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/liquidity/reverse.py +0 -0
  91. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/liquidity/runoff.py +0 -0
  92. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/liquidity/scenarios.py +0 -0
  93. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/__init__.py +0 -0
  94. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/caviar.py +0 -0
  95. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/conventions.py +0 -0
  96. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/evt.py +0 -0
  97. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/frtb.py +0 -0
  98. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/garch.py +0 -0
  99. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/gas_fz.py +0 -0
  100. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/historical.py +0 -0
  101. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/parametric.py +0 -0
  102. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/market/scoring.py +0 -0
  103. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/__init__.py +0 -0
  104. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/_checks.py +0 -0
  105. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/_logistic.py +0 -0
  106. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/cbpe.py +0 -0
  107. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/challenger.py +0 -0
  108. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/conformal.py +0 -0
  109. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/dataquality.py +0 -0
  110. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/effects.py +0 -0
  111. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/explanations.py +0 -0
  112. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/generalisation.py +0 -0
  113. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/leakage.py +0 -0
  114. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/plants.py +0 -0
  115. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/policy.py +0 -0
  116. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/robustness.py +0 -0
  117. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/ml/seeds.py +0 -0
  118. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/oprisk/__init__.py +0 -0
  119. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/oprisk/_checks.py +0 -0
  120. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/oprisk/aggregate.py +0 -0
  121. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/oprisk/distributions.py +0 -0
  122. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/oprisk/scenarios.py +0 -0
  123. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/oprisk/sla.py +0 -0
  124. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/oprisk/sma.py +0 -0
  125. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/policies/__init__.py +0 -0
  126. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/portfolio/__init__.py +0 -0
  127. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/portfolio/asrf_fit.py +0 -0
  128. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/portfolio/copula.py +0 -0
  129. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/portfolio/creditrisk_plus.py +0 -0
  130. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/portfolio/euler.py +0 -0
  131. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/portfolio/granularity.py +0 -0
  132. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/portfolio/importance.py +0 -0
  133. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/portfolio/portfolio.py +0 -0
  134. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/provisions/__init__.py +0 -0
  135. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/provisions/_checks.py +0 -0
  136. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/provisions/ecl.py +0 -0
  137. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/provisions/local_cl.py +0 -0
  138. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/provisions/local_es.py +0 -0
  139. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/provisions/overlays.py +0 -0
  140. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/provisions/reconciliation.py +0 -0
  141. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/provisions/staging.py +0 -0
  142. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/provisions/term_structure.py +0 -0
  143. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/regulatory/__init__.py +0 -0
  144. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/regulatory/ba_cva.py +0 -0
  145. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/regulatory/frtb.py +0 -0
  146. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/regulatory/irb.py +0 -0
  147. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/regulatory/lcr_nsfr.py +0 -0
  148. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/regulatory/output_floor.py +0 -0
  149. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/regulatory/sa_ccr.py +0 -0
  150. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/regulatory/standardised.py +0 -0
  151. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/stress/__init__.py +0 -0
  152. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/stress/capital.py +0 -0
  153. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/stress/paths.py +0 -0
  154. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/stress/reverse.py +0 -0
  155. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/stress/satellites.py +0 -0
  156. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/stress/scenario_models.py +0 -0
  157. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/transitions/__init__.py +0 -0
  158. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/transitions/em.py +0 -0
  159. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/transitions/embedding.py +0 -0
  160. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/transitions/estimators.py +0 -0
  161. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/transitions/intervals.py +0 -0
  162. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/transitions/mobility.py +0 -0
  163. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/transitions/ttc.py +0 -0
  164. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/_common.py +0 -0
  165. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/aggregation.py +0 -0
  166. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/calibration.py +0 -0
  167. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/ccr.py +0 -0
  168. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/discrimination.py +0 -0
  169. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/ifrs9.py +0 -0
  170. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/irrbb.py +0 -0
  171. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/lgd_ead.py +0 -0
  172. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/liquidity.py +0 -0
  173. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/market.py +0 -0
  174. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/ml.py +0 -0
  175. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/oprisk.py +0 -0
  176. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/portfolio.py +0 -0
  177. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/rating_system.py +0 -0
  178. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/stability.py +0 -0
  179. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/stress.py +0 -0
  180. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation/validation/transitions.py +0 -0
  181. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation.egg-info/dependency_links.txt +0 -0
  182. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation.egg-info/requires.txt +0 -0
  183. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/src/riskvalidation.egg-info/top_level.txt +0 -0
  184. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_catalogue.py +0 -0
  185. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_default_policy_batch3.py +0 -0
  186. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_discrimination.py +0 -0
  187. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_docs.py +0 -0
  188. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_examples.py +0 -0
  189. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_generators.py +0 -0
  190. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_harness.py +0 -0
  191. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_hashing.py +0 -0
  192. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_imports.py +0 -0
  193. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_irb.py +0 -0
  194. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_low_default.py +0 -0
  195. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_pd_calibration.py +0 -0
  196. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_pd_curve.py +0 -0
  197. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_policy.py +0 -0
  198. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_rating_system.py +0 -0
  199. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_reproductions.py +0 -0
  200. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_result_schema.py +0 -0
  201. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_size.py +0 -0
  202. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_stability.py +0 -0
  203. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_suite.py +0 -0
  204. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_transitions.py +0 -0
  205. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_transitions_reconciliation.py +0 -0
  206. {riskvalidation-0.8.0 → riskvalidation-0.9.0}/tests/test_vasicek.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: riskvalidation
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: Validation tests, regulatory calculators and reference engines for financial risk models: the toolkit of an independent model validator.
5
5
  Author: Felipe Santibáñez-Leal
6
6
  License-Expression: MIT
@@ -50,7 +50,7 @@ same wheel runs in a Python pipeline and in the browser under Pyodide.
50
50
 
51
51
  ## Status
52
52
 
53
- Version 0.08.000: liquidity (run-off, deposits, the counterbalancing capacity, the maturity ladder and reverse liquidity stress), aggregation (simple sum and variance-covariance, copulas, bounds and the dependence band, aggregation model risk), stress testing (satellites, scenario models, path transposition, the capital path, reverse stress), the regulatory calculators (the standardised approach, IRB, the output floor, SA-CCR, BA-CVA, the FRTB sensitivities-based method and liquidity-horizon cascade, LCR and NSFR), counterparty credit risk (Hull-White one-factor exposure, swaps, collateral, CVA), machine-learning model validation and fair lending, each with its validation tests; 0.07.000: portfolio credit capital (copula Monte Carlo, CreditRisk+, the granularity adjustment, importance sampling, Euler contributions, the Vasicek fit), market risk (VaR and ES estimators, scoring, the model confidence set, the FRTB back-tests and PLA), interest rate risk in the banking book (SRP31 and RAN 21-13 Annex 1 EVE and NII, behavioural models, EaR and EVaR) and operational risk (LDA by Monte Carlo, Panjer and FFT, the SMA), each with its validation tests; 0.06.000: loss given default and exposure at default (workout LGD, the LGD rungs, downturn LGD, CCF and EAD, the IRB floors, and their validation tests); 0.05.000: provisions (the IFRS 9 expected credit loss engine with its validation battery, and the CMF B-1 and BdE Annex 9 statutory provisions); before it, the core contracts (result record, policy, registry, suite runner); 27 validation tests for
53
+ Version 0.09.000: model governance (the scope test, the inventory and its dependency graph, tiering, the lifecycle, the findings register, the review schedule, the overall opinion, the risk appetite metrics, the policy identity of a test row and the validation report), with its five `gov.` validation tests; 0.08.001: the fairness metric rows carry null alphas, their cut points in extras; 0.08.000: liquidity (run-off, deposits, the counterbalancing capacity, the maturity ladder and reverse liquidity stress), aggregation (simple sum and variance-covariance, copulas, bounds and the dependence band, aggregation model risk), stress testing (satellites, scenario models, path transposition, the capital path, reverse stress), the regulatory calculators (the standardised approach, IRB, the output floor, SA-CCR, BA-CVA, the FRTB sensitivities-based method and liquidity-horizon cascade, LCR and NSFR), counterparty credit risk (Hull-White one-factor exposure, swaps, collateral, CVA), machine-learning model validation and fair lending, each with its validation tests; 0.07.000: portfolio credit capital (copula Monte Carlo, CreditRisk+, the granularity adjustment, importance sampling, Euler contributions, the Vasicek fit), market risk (VaR and ES estimators, scoring, the model confidence set, the FRTB back-tests and PLA), interest rate risk in the banking book (SRP31 and RAN 21-13 Annex 1 EVE and NII, behavioural models, EaR and EVaR) and operational risk (LDA by Monte Carlo, Panjer and FFT, the SMA), each with its validation tests; 0.06.000: loss given default and exposure at default (workout LGD, the LGD rungs, downturn LGD, CCF and EAD, the IRB floors, and their validation tests); 0.05.000: provisions (the IFRS 9 expected credit loss engine with its validation battery, and the CMF B-1 and BdE Annex 9 statutory provisions); before it, the core contracts (result record, policy, registry, suite runner); 27 validation tests for
54
54
  PD calibration, discrimination, rating-system stability, population stability and rating transitions; the IRB
55
55
  risk-weight functions under four regimes; three reference engines (the one-factor model with its large homogeneous
56
56
  portfolio, most prudent estimation for low-default portfolios, PD curve calibration after Tasche 2013); rating
@@ -13,7 +13,7 @@ same wheel runs in a Python pipeline and in the browser under Pyodide.
13
13
 
14
14
  ## Status
15
15
 
16
- Version 0.08.000: liquidity (run-off, deposits, the counterbalancing capacity, the maturity ladder and reverse liquidity stress), aggregation (simple sum and variance-covariance, copulas, bounds and the dependence band, aggregation model risk), stress testing (satellites, scenario models, path transposition, the capital path, reverse stress), the regulatory calculators (the standardised approach, IRB, the output floor, SA-CCR, BA-CVA, the FRTB sensitivities-based method and liquidity-horizon cascade, LCR and NSFR), counterparty credit risk (Hull-White one-factor exposure, swaps, collateral, CVA), machine-learning model validation and fair lending, each with its validation tests; 0.07.000: portfolio credit capital (copula Monte Carlo, CreditRisk+, the granularity adjustment, importance sampling, Euler contributions, the Vasicek fit), market risk (VaR and ES estimators, scoring, the model confidence set, the FRTB back-tests and PLA), interest rate risk in the banking book (SRP31 and RAN 21-13 Annex 1 EVE and NII, behavioural models, EaR and EVaR) and operational risk (LDA by Monte Carlo, Panjer and FFT, the SMA), each with its validation tests; 0.06.000: loss given default and exposure at default (workout LGD, the LGD rungs, downturn LGD, CCF and EAD, the IRB floors, and their validation tests); 0.05.000: provisions (the IFRS 9 expected credit loss engine with its validation battery, and the CMF B-1 and BdE Annex 9 statutory provisions); before it, the core contracts (result record, policy, registry, suite runner); 27 validation tests for
16
+ Version 0.09.000: model governance (the scope test, the inventory and its dependency graph, tiering, the lifecycle, the findings register, the review schedule, the overall opinion, the risk appetite metrics, the policy identity of a test row and the validation report), with its five `gov.` validation tests; 0.08.001: the fairness metric rows carry null alphas, their cut points in extras; 0.08.000: liquidity (run-off, deposits, the counterbalancing capacity, the maturity ladder and reverse liquidity stress), aggregation (simple sum and variance-covariance, copulas, bounds and the dependence band, aggregation model risk), stress testing (satellites, scenario models, path transposition, the capital path, reverse stress), the regulatory calculators (the standardised approach, IRB, the output floor, SA-CCR, BA-CVA, the FRTB sensitivities-based method and liquidity-horizon cascade, LCR and NSFR), counterparty credit risk (Hull-White one-factor exposure, swaps, collateral, CVA), machine-learning model validation and fair lending, each with its validation tests; 0.07.000: portfolio credit capital (copula Monte Carlo, CreditRisk+, the granularity adjustment, importance sampling, Euler contributions, the Vasicek fit), market risk (VaR and ES estimators, scoring, the model confidence set, the FRTB back-tests and PLA), interest rate risk in the banking book (SRP31 and RAN 21-13 Annex 1 EVE and NII, behavioural models, EaR and EVaR) and operational risk (LDA by Monte Carlo, Panjer and FFT, the SMA), each with its validation tests; 0.06.000: loss given default and exposure at default (workout LGD, the LGD rungs, downturn LGD, CCF and EAD, the IRB floors, and their validation tests); 0.05.000: provisions (the IFRS 9 expected credit loss engine with its validation battery, and the CMF B-1 and BdE Annex 9 statutory provisions); before it, the core contracts (result record, policy, registry, suite runner); 27 validation tests for
17
17
  PD calibration, discrimination, rating-system stability, population stability and rating transitions; the IRB
18
18
  risk-weight functions under four regimes; three reference engines (the one-factor model with its large homogeneous
19
19
  portfolio, most prudent estimation for low-default portfolios, PD curve calibration after Tasche 2013); rating
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
8
8
  [project]
9
9
  name = "riskvalidation"
10
10
  # PEP 440 form of the display version X.XX.XXX in VERSION (see CHANGELOG.md and riskvalidation.__version__).
11
- version = "0.8.0"
11
+ version = "0.9.0"
12
12
  description = "Validation tests, regulatory calculators and reference engines for financial risk models: the toolkit of an independent model validator."
13
13
  readme = "README.md"
14
14
  requires-python = ">=3.10"
@@ -11,7 +11,7 @@ from riskvalidation.core.registry import TestSpec, catalogue
11
11
  from riskvalidation.core.result import Light, TestResult
12
12
  from riskvalidation.core.suite import SuiteRun, run_suite
13
13
 
14
- __version__ = "0.8.0"
14
+ __version__ = "0.9.0"
15
15
  """PEP 440 form of the display version in ``VERSION``."""
16
16
 
17
17
  __all__ = [
@@ -0,0 +1,16 @@
1
+ """Model governance: the scope test, the inventory and its dependency graph, the tiering rubric, the lifecycle, the
2
+ findings workflow, the review schedule, the overall opinion, the model risk appetite metrics, the policy identity
3
+ of a test row and the validation report (contract `engine-governance-api` 1.0.0; dossier 06 B and I).
4
+
5
+ Modules are imported by path (for example ``from riskvalidation.governance.tiering import matrix_tier``). The
6
+ engine computes; it approves nothing and certifies nothing. Every tier count, band, deadline, frequency and
7
+ threshold is a stated **convention**: a named parameter that carries the label ``convention``
8
+ (:data:`CONVENTIONS`), passed to its function as an argument with the default of
9
+ :mod:`riskvalidation.governance.conventions`, and never presented as a value taken from a regulation. No function
10
+ reads the clock, the environment or a file: the as-of date and every table come in as arguments. The ``gov.``
11
+ validation tests are in :mod:`riskvalidation.validation.governance`.
12
+ """
13
+
14
+ from riskvalidation.governance.conventions import CONVENTIONS
15
+
16
+ __all__ = ["CONVENTIONS"]
@@ -0,0 +1,268 @@
1
+ """The model risk appetite metrics (dossier 06 B.6 l.606-612): each with its value, unit, numerator, denominator and
2
+ a light under a stated threshold, which is a **convention** (a direction, a green limit and an amber limit per
3
+ metric, inclusive on the good side).
4
+
5
+ Entries are read in their document form (a mapping with ``tier_block``, ``schedule``, ``lifecycle`` and
6
+ ``attributes``) and register rows as mappings (``entry_key``, ``id``, ``status``, ``severity``, ``overdue``). The
7
+ two finding counts count distinct (entry, id) findings, which is what B.6 counts (W15-14); the number of register
8
+ rows behind the numerator is the secondary number beside them, and a finding repeated in n variants of an entry
9
+ counts once.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from collections.abc import Mapping, Sequence
15
+ from datetime import date
16
+ from typing import Any
17
+
18
+ from riskvalidation.governance.conventions import APPETITE_THRESHOLDS, CONVENTION
19
+ from riskvalidation.governance.findings import OPEN_STATES
20
+
21
+ DIRECTIONS = ("lower-is-better", "higher-is-better")
22
+ METRIC_IDS = tuple(APPETITE_THRESHOLDS)
23
+ _COMPLETE_OWNER = ("present", "derivable", "convention")
24
+ _PERCENT = ("share", "share-of-model-output")
25
+
26
+
27
+ def light(value: float | None, direction: str, green_limit: float, amber_limit: float) -> str:
28
+ """``green``, ``amber``, ``red`` or ``not_evaluated`` (no value); the limits are inclusive on the good side."""
29
+ if direction not in DIRECTIONS:
30
+ raise ValueError(f"direction must be one of {DIRECTIONS}, got {direction!r}")
31
+ if value is None:
32
+ return "not_evaluated"
33
+ if direction == "lower-is-better":
34
+ return "green" if value <= green_limit else "amber" if value <= amber_limit else "red"
35
+ return "green" if value >= green_limit else "amber" if value >= amber_limit else "red"
36
+
37
+
38
+ def _next_review(entry: Mapping[str, Any]) -> date:
39
+ value = entry["schedule"]["next_review"]
40
+ return value if isinstance(value, date) else date.fromisoformat(value)
41
+
42
+
43
+ def _tier1(entries: Sequence[Mapping[str, Any]]) -> list[Mapping[str, Any]]:
44
+ return [e for e in entries if e["tier_block"]["tier"] == 1]
45
+
46
+
47
+ def tier1_validated_on_time(
48
+ entries: Sequence[Mapping[str, Any]], as_of: date
49
+ ) -> tuple[float | None, float | None, float | None]:
50
+ """(Tier 1 entries whose next review is on or after the as-of date, Tier 1 entries, their share); the share is
51
+ ``None`` with none."""
52
+ t1 = _tier1(entries)
53
+ on_time = sum(1 for e in t1 if _next_review(e) >= as_of)
54
+ return on_time, len(t1), (on_time / len(t1) if t1 else None)
55
+
56
+
57
+ def _distinct(rows: Sequence[Mapping[str, Any]]) -> int:
58
+ return len({(r["entry_key"], r["id"]) for r in rows})
59
+
60
+
61
+ def open_high_severity(rows: Sequence[Mapping[str, Any]]) -> tuple[float, float, float, int]:
62
+ """(distinct open S1 or S2 findings, distinct findings of the register, the count, register rows behind the
63
+ numerator)."""
64
+ sel = [r for r in rows if r["status"] in OPEN_STATES and r["severity"] in ("S1", "S2")]
65
+ n = _distinct(sel)
66
+ return n, _distinct(rows), n, len(sel)
67
+
68
+
69
+ def overdue_remediation(rows: Sequence[Mapping[str, Any]]) -> tuple[float, float, float, int]:
70
+ """(distinct findings with an overdue row, distinct findings of the register, the count, the overdue rows)."""
71
+ sel = [r for r in rows if r["overdue"]]
72
+ n = _distinct(sel)
73
+ return n, _distinct(rows), n, len(sel)
74
+
75
+
76
+ def entries_under_exception(entries: Sequence[Mapping[str, Any]]) -> tuple[float, float, float]:
77
+ """(entries whose lifecycle holds an exception record, the entries, the count)."""
78
+ n = sum(1 for e in entries if e["lifecycle"]["exception"])
79
+ return n, len(entries), n
80
+
81
+
82
+ def _red_rows(entry: Mapping[str, Any]) -> int:
83
+ a36 = entry["attributes"]["A36"]["value"]
84
+ if not isinstance(a36, Mapping) or "red" not in a36:
85
+ who = entry.get("key", "an entry")
86
+ raise ValueError(f"{who}: A36 holds no light counts, so the entry cannot be counted in breach or not")
87
+ return a36["red"]
88
+
89
+
90
+ def entries_in_breach(entries: Sequence[Mapping[str, Any]]) -> tuple[float, float, float]:
91
+ """(entries with at least one red test row on any variant, the entries, the count)."""
92
+ n = sum(1 for e in entries if _red_rows(e) > 0)
93
+ return n, len(entries), n
94
+
95
+
96
+ def pma_magnitude(entries: Sequence[Mapping[str, Any]]) -> tuple[float | None, float | None, float | None]:
97
+ """(sum of the PMA overlays, sum of the model outputs they adjust, their ratio); ``(None, None, None)`` with no
98
+ PMA amount.
99
+
100
+ A PMA is attribute A26 with status ``present`` holding ``overlays_total``, ``currency`` and ``model_output``.
101
+ Amounts are never converted: two currencies raise ``ValueError``.
102
+ """
103
+ pmas = [e["attributes"]["A26"]["value"] for e in entries if e["attributes"]["A26"]["status"] == "present"]
104
+ pmas = [
105
+ p
106
+ for p in pmas
107
+ if isinstance(p, Mapping) and p.get("overlays_total") is not None and p.get("model_output") is not None
108
+ ]
109
+ if not pmas:
110
+ return None, None, None
111
+ currencies = sorted({p.get("currency") for p in pmas}, key=str)
112
+ if len(currencies) > 1:
113
+ raise ValueError(
114
+ f"PMA amounts are in different currencies ({', '.join(map(str, currencies))}); amounts are never converted"
115
+ )
116
+ overlays = sum(p["overlays_total"] for p in pmas)
117
+ output = sum(p["model_output"] for p in pmas)
118
+ return overlays, output, (overlays / output if output else None)
119
+
120
+
121
+ def owner_and_complete_record(entries: Sequence[Mapping[str, Any]]) -> tuple[float, float, float]:
122
+ """(entries with an owner (A28 present, derivable or convention) and no missing attribute, the entries, their
123
+ share).
124
+ """
125
+ n = sum(
126
+ 1
127
+ for e in entries
128
+ if e["attributes"]["A28"]["status"] in _COMPLETE_OWNER
129
+ and all(a["status"] != "missing" for a in e["attributes"].values())
130
+ )
131
+ return n, len(entries), (n / len(entries) if entries else None) # type: ignore[return-value]
132
+
133
+
134
+ def appetite_population(entries: Sequence[Mapping[str, Any]], rows: Sequence[Mapping[str, Any]]) -> dict[str, int]:
135
+ """The ``population`` of the appetite document: entries, register rows, distinct findings and Tier 1 entries."""
136
+ return {
137
+ "entries": len(entries),
138
+ "findings": len(rows),
139
+ "distinct_findings": _distinct(rows),
140
+ "tier1_entries": len(_tier1(entries)),
141
+ }
142
+
143
+
144
+ def _bilingual(en: str, es: str) -> dict[str, str]:
145
+ return {"en": en, "es": es}
146
+
147
+
148
+ # id -> (name, kind, unit, reason when the metric has no value)
149
+ _META: dict[str, tuple[dict[str, str], str, str, dict[str, str] | None]] = {
150
+ "tier1-validated-on-time": (
151
+ _bilingual("Share of Tier 1 entries validated on time", "Proporcion de entradas de Nivel 1 validadas a tiempo"),
152
+ "share",
153
+ "share",
154
+ _bilingual("no Tier 1 entry exists", "no existe entrada de Nivel 1"),
155
+ ),
156
+ "open-high-severity": (
157
+ _bilingual("Open high-severity findings (S1 and S2)", "Hallazgos abiertos de severidad alta (S1 y S2)"),
158
+ "count",
159
+ "count",
160
+ None,
161
+ ),
162
+ "overdue-remediation": (_bilingual("Overdue remediation", "Remediacion vencida"), "count", "count", None),
163
+ "entries-under-exception": (
164
+ _bilingual("Entries used under exception", "Entradas usadas bajo excepcion"),
165
+ "count",
166
+ "count",
167
+ None,
168
+ ),
169
+ "entries-in-breach": (
170
+ _bilingual(
171
+ "Entries in breach of their thresholds (a red test row)",
172
+ "Entradas que incumplen sus umbrales (una fila de prueba roja)",
173
+ ),
174
+ "count",
175
+ "count",
176
+ None,
177
+ ),
178
+ "pma-magnitude": (
179
+ _bilingual("PMA magnitude relative to the model output", "Magnitud de PMA relativa al resultado del modelo"),
180
+ "magnitude",
181
+ "share-of-model-output",
182
+ _bilingual("no entry holds a PMA with an amount", "ninguna entrada tiene una PMA con monto"),
183
+ ),
184
+ "owner-and-complete-record": (
185
+ _bilingual(
186
+ "Share of entries with an owner role and a complete record",
187
+ "Proporcion de entradas con rol de propietario y registro completo",
188
+ ),
189
+ "share",
190
+ "share",
191
+ _bilingual("no entry exists", "no existe ninguna entrada"),
192
+ ),
193
+ }
194
+
195
+
196
+ def _limit(x: float, unit: str) -> str:
197
+ return f"{x * 100:g} percent" if unit in _PERCENT else f"{x:g}"
198
+
199
+
200
+ def _basis(unit: str, direction: str, green: float, amber: float) -> str:
201
+ if direction == "lower-is-better":
202
+ text = f"green up to {_limit(green, unit)}, amber up to {_limit(amber, unit)}, red above"
203
+ else:
204
+ text = f"green from {_limit(green, unit)}, amber from {_limit(amber, unit)}, red below"
205
+ return f"a convention (item 30 of the dossier UNVERIFIED list): {text}"
206
+
207
+
208
+ def appetite_metrics(
209
+ entries: Sequence[Mapping[str, Any]],
210
+ rows: Sequence[Mapping[str, Any]],
211
+ as_of: date,
212
+ thresholds: Mapping[str, tuple[str, float, float]] = APPETITE_THRESHOLDS,
213
+ ) -> tuple[dict, ...]:
214
+ """The seven metric records in the order of B.6, each with its value, unit, numerator, denominator,
215
+ ``register_rows`` (a number for the two distinct-finding counts, ``None`` for the others), threshold (labelled
216
+ ``convention``) and light; a metric with no value has the light ``not_evaluated`` and a reason."""
217
+ missing = [m for m in METRIC_IDS if m not in thresholds]
218
+ if missing:
219
+ raise ValueError(f"the thresholds hold no row for {', '.join(missing)}")
220
+ t1 = tier1_validated_on_time(entries, as_of)
221
+ high = open_high_severity(rows)
222
+ over = overdue_remediation(rows)
223
+ exc = entries_under_exception(entries)
224
+ breach = entries_in_breach(entries)
225
+ pma = pma_magnitude(entries)
226
+ owner = owner_and_complete_record(entries)
227
+ parts: dict[str, tuple[Any, Any, int | None]] = {
228
+ "tier1-validated-on-time": (t1[0], t1[1], None),
229
+ "open-high-severity": (high[0], high[1], high[3]),
230
+ "overdue-remediation": (over[0], over[1], over[3]),
231
+ "entries-under-exception": (exc[0], exc[1], None),
232
+ "entries-in-breach": (breach[0], breach[1], None),
233
+ "pma-magnitude": (pma[0], pma[1], None),
234
+ "owner-and-complete-record": (owner[0], owner[1], None),
235
+ }
236
+ out = []
237
+ for mid in METRIC_IDS:
238
+ name, kind, unit, reason = _META[mid]
239
+ num, den, reg_rows = parts[mid]
240
+ direction, green, amber = thresholds[mid]
241
+ if num is None:
242
+ value = None
243
+ elif unit == "count":
244
+ value = num
245
+ else:
246
+ value = num / den if den else None
247
+ out.append(
248
+ {
249
+ "id": mid,
250
+ "name": dict(name),
251
+ "kind": kind,
252
+ "value": value,
253
+ "unit": unit,
254
+ "numerator": num,
255
+ "denominator": den,
256
+ "register_rows": reg_rows,
257
+ "reason": dict(reason) if (value is None and reason is not None) else None,
258
+ "threshold": {
259
+ "label": CONVENTION,
260
+ "basis": _basis(unit, direction, green, amber),
261
+ "direction": direction,
262
+ "green_limit": green,
263
+ "amber_limit": amber,
264
+ },
265
+ "light": light(value, direction, green, amber),
266
+ }
267
+ )
268
+ return tuple(out)
@@ -0,0 +1,161 @@
1
+ """The named convention parameters of the governance package (contract `engine-governance-api` 1.0.0, section
2
+ Conventions).
3
+
4
+ Every table below is a **convention**: a named parameter that carries the label `convention` and its basis, passed
5
+ to the function that uses it as an argument with the default stated here. None is presented as a value taken from
6
+ a regulation (dossier 06, item 30 of the UNVERIFIED list, l.1321-1322). The one exception in kind is the pair of
7
+ ECB cut points of an RWEA anchor in `opinion` (Instructions of February 2019, section 2.4.2), which are the ECB's;
8
+ the rule that turns findings into a level is a convention here as well.
9
+
10
+ This module imports nothing: it is the leaf every other governance module reads its defaults from.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ CONVENTION = "convention"
16
+
17
+ # 06 B.3: M is banded at "configurable cut-offs" and fixes none; the share of the stated balance at 25, 10 and 2
18
+ # percent (A D2 3.2, W15-3).
19
+ EXPOSURE_BAND_CUTS: tuple[float, float, float] = (0.25, 0.10, 0.02)
20
+
21
+ # 06 B.7 names no days: days from the raised date, severity S1 to S4 by tier 1 to 4 (W15-5).
22
+ DEADLINE_DAYS: dict[str, tuple[int, int, int, int]] = {
23
+ "S1": (30, 45, 60, 90),
24
+ "S2": (60, 90, 120, 180),
25
+ "S3": (90, 120, 180, 270),
26
+ "S4": (180, 270, 365, 365),
27
+ }
28
+
29
+ # 06 B.8 l.636-640: tier to (review, full revalidation, monitoring) in calendar months; tier 4 is an attestation.
30
+ FREQUENCY: dict[int, tuple[int, int | None, int | None]] = {
31
+ 1: (12, 36, 3),
32
+ 2: (12, 36, 6),
33
+ 3: (24, None, 12),
34
+ 4: (36, None, None),
35
+ }
36
+
37
+ # 06 B.6 l.606-612: (direction, green limit, amber limit) per metric id; the limits are inclusive on the good side.
38
+ APPETITE_THRESHOLDS: dict[str, tuple[str, float, float]] = {
39
+ "tier1-validated-on-time": ("higher-is-better", 0.9, 0.75),
40
+ "open-high-severity": ("lower-is-better", 0, 3),
41
+ "overdue-remediation": ("lower-is-better", 0, 3),
42
+ "entries-under-exception": ("lower-is-better", 0, 1),
43
+ "entries-in-breach": ("lower-is-better", 0, 1),
44
+ "pma-magnitude": ("lower-is-better", 0.01, 0.03),
45
+ "owner-and-complete-record": ("higher-is-better", 0.9, 0.5),
46
+ }
47
+
48
+ # W15-3: the grades of regulatory use; the literal reading is never below the graded one.
49
+ REGULATORY_USE_GRADES = {
50
+ "graded": {"reported_figure": 4, "feeding_parameter": 3, "compliance_monitoring": 2, "none": 1},
51
+ "literal": {"feeds_capital_provisioning_or_reporting": 4, "compliance_monitoring": 2, "none": 1},
52
+ }
53
+
54
+ # 06 l.567: C is the mean of the factor scores; the rounding is not in the text, half up is used (A D2 3.3).
55
+ COMPLEXITY_AGGREGATION = {"aggregation": "mean", "rounding": "half-up"}
56
+
57
+ # W15-3: regulatory use graded, complexity the mean rounded half up; the other three readings are shown beside it.
58
+ ADOPTED_READING = "B"
59
+
60
+ # 06 B.4 l.576-583 synthesised from SS1/23 para 2.10, OSFI E-23 and SR 11-7: the allowed transitions of the twelve
61
+ # states.
62
+ LIFECYCLE_GRAPH: dict[str, tuple[str, ...]] = {
63
+ "proposed": ("in_development",),
64
+ "in_development": ("submitted_for_validation",),
65
+ "submitted_for_validation": ("in_validation",),
66
+ "in_validation": ("approved", "approved_with_conditions", "in_development"),
67
+ "approved": ("in_use",),
68
+ "approved_with_conditions": ("in_use",),
69
+ "in_use": ("under_monitoring_alert", "material_change_pending", "in_validation", "restricted", "decommissioned"),
70
+ "under_monitoring_alert": ("in_use", "restricted", "in_remediation"),
71
+ "restricted": ("in_remediation", "in_use", "decommissioned"),
72
+ "in_remediation": ("in_validation", "restricted", "decommissioned"),
73
+ "material_change_pending": ("submitted_for_validation", "in_use"),
74
+ "decommissioned": (),
75
+ }
76
+
77
+ # 06 l.624-628 names the seven states and no transition: the graph is this contract's proposal.
78
+ FINDING_GRAPH: dict[str, tuple[str, ...]] = {
79
+ "open": ("action_plan_agreed", "risk_accepted", "overdue"),
80
+ "action_plan_agreed": ("in_progress", "risk_accepted", "overdue"),
81
+ "in_progress": ("submitted_for_closure", "risk_accepted", "overdue"),
82
+ "submitted_for_closure": ("validated_closed", "in_progress", "overdue"),
83
+ "validated_closed": (),
84
+ "overdue": ("in_progress", "submitted_for_closure", "risk_accepted"),
85
+ "risk_accepted": ("open",),
86
+ }
87
+
88
+ # W15-7: the level of an entry follows its open findings; the recommendation is the rule's text for the level.
89
+ RECOMMENDATION_RULE = {
90
+ 1: "approve",
91
+ 2: "approve with conditions",
92
+ 3: "remediate before use",
93
+ 4: "remediate before use",
94
+ }
95
+
96
+ CONVENTIONS: dict[str, dict[str, str]] = {
97
+ "EXPOSURE_BAND_CUTS": {
98
+ "label": CONVENTION,
99
+ "basis": "share of the stated balance at least 25 percent is band 4, 10 percent 3, 2 percent 2, below that "
100
+ "1; dossier 06 B.3 fixes no "
101
+ "cut-offs (item 30 of the UNVERIFIED list; A D2 3.2, W15-3)",
102
+ },
103
+ "DEADLINE_DAYS": {
104
+ "label": CONVENTION,
105
+ "basis": "days from the raised date by severity S1 to S4 and tier 1 to 4; no source prescribes days (06 "
106
+ "B.7), so the table is a "
107
+ "proposal (item 30 of the UNVERIFIED list; W15-5)",
108
+ },
109
+ "FREQUENCY": {
110
+ "label": CONVENTION,
111
+ "basis": "06 B.8 l.636-640: Tier 1 annual review, full revalidation every 3 years, quarterly monitoring; "
112
+ "Tier 2 annual, 3 years, "
113
+ "semi-annual; Tier 3 every 2 years with annual monitoring; Tier 4 an attestation every 3 years; "
114
+ "configurable, and the "
115
+ "ECB minimums of 12 and 36 months replace it for the profile `ecb` (item 30)",
116
+ },
117
+ "APPETITE_THRESHOLDS": {
118
+ "label": CONVENTION,
119
+ "basis": "06 B.6 l.606-612 names the metrics and no limits; each limit is a proposal with a direction, a "
120
+ "green limit and an amber "
121
+ "limit, inclusive on the good side (item 30)",
122
+ },
123
+ "REGULATORY_USE_GRADES": {
124
+ "label": CONVENTION,
125
+ "basis": "W15-3: graded 4 where the output is itself the reported or binding figure, 3 where it is a "
126
+ "parameter or a back-test that "
127
+ "feeds one, 2 for compliance monitoring, 1 for none; literal 4 whenever the output feeds capital, "
128
+ "provisioning or "
129
+ "reporting; the literal grade is never below the graded one (A D2 3.2)",
130
+ },
131
+ "COMPLEXITY_AGGREGATION": {
132
+ "label": CONVENTION,
133
+ "basis": "06 l.567: C is the mean of the factor scores; the rounding is not in the text, half up is used "
134
+ "and the maximum is the "
135
+ "alternative reading (A D2 3.3)",
136
+ },
137
+ "ADOPTED_READING": {
138
+ "label": CONVENTION,
139
+ "basis": "W15-3: the reading B (regulatory use graded, complexity the mean rounded half up) sets the tier; "
140
+ "the other three readings "
141
+ "are shown beside it by `tier_sensitivity`",
142
+ },
143
+ "LIFECYCLE_GRAPH": {
144
+ "label": CONVENTION,
145
+ "basis": "06 B.4 l.576-583, a synthesis of SS1/23 para 2.10, OSFI E-23 and SR 11-7; use before validation "
146
+ "only with an exception "
147
+ "record (type, approver, expiry date)",
148
+ },
149
+ "FINDING_GRAPH": {
150
+ "label": CONVENTION,
151
+ "basis": "06 l.624-628 names the seven states and no transition; the graph is this contract's proposal "
152
+ "(item 30)",
153
+ },
154
+ "RECOMMENDATION_RULE": {
155
+ "label": CONVENTION,
156
+ "basis": "W15-7: level 1 with no open finding, 2 with S4 or S3 only, 3 with any S2, 4 with any S1; an RWEA "
157
+ "anchor can only raise a "
158
+ "level (the 5 and 10 percent cut points are the ECB's, Instructions of February 2019, section 2.4.2); the "
159
+ "recommendation is the rule's output on the evidence (item 30)",
160
+ },
161
+ }