opencomplai-cli 0.13.2__tar.gz → 0.15.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 (221) hide show
  1. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/PKG-INFO +10 -4
  2. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/README.md +3 -2
  3. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/pyproject.toml +15 -2
  4. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/__init__.py +1 -1
  5. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/acceptance_gate.py +3 -0
  6. opencomplai_cli-0.15.0/src/opencomplai_cli/attestations.py +394 -0
  7. opencomplai_cli-0.15.0/src/opencomplai_cli/commands/attestations.py +81 -0
  8. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/checker.py +12 -1
  9. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/push.py +3 -4
  10. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/data/checker-local.html +5 -5
  11. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/main.py +226 -15
  12. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/publish.py +3 -0
  13. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/check_eu_artifact.json +3 -3
  14. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/check_eu_stdout.json +3 -3
  15. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/check_nist_artifact.json +295 -312
  16. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/check_nist_stdout.json +295 -312
  17. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/gaps_chatbot.json +3 -3
  18. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/gaps_chatbot.txt +63 -63
  19. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/gaps_credit.json +3 -3
  20. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/gaps_credit.txt +63 -63
  21. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/gaps_credit_nist.json +293 -310
  22. opencomplai_cli-0.15.0/tests/golden/gaps_credit_nist.txt +177 -0
  23. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/recommend_files.txt +1 -1
  24. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/report.html +2 -2
  25. opencomplai_cli-0.15.0/tests/test_attestations_cmd.py +1383 -0
  26. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_gate.py +1 -1
  27. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_checker_roles.py +3 -3
  28. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_ci_strict_reading.py +18 -20
  29. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_cli_docs_pages.py +20 -5
  30. opencomplai_cli-0.15.0/tests/test_docs_generate_cybersecurity.py +130 -0
  31. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_truth.py +1 -1
  32. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_works_alongside.py +20 -0
  33. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_gaps_multi_target.py +2 -2
  34. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_gaps_nist_rmf_target.py +15 -15
  35. opencomplai_cli-0.15.0/tests/test_github_action.py +177 -0
  36. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_release_pins_parity.py +3 -3
  37. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_release_runbook_docs.py +16 -0
  38. opencomplai_cli-0.13.2/tests/golden/gaps_credit_nist.txt +0 -205
  39. opencomplai_cli-0.13.2/tests/test_github_action.py +0 -635
  40. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/.gitignore +0 -0
  41. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/_encoding.py +0 -0
  42. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/agent_inventory_payload.py +0 -0
  43. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/ai_status.py +0 -0
  44. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/check_signing.py +0 -0
  45. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/__init__.py +0 -0
  46. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/accept.py +0 -0
  47. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/agents.py +0 -0
  48. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/agents_attest.py +0 -0
  49. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/agents_runtime.py +0 -0
  50. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/agents_verify_log.py +0 -0
  51. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/checker_manifest.py +0 -0
  52. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/controls.py +0 -0
  53. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/dashboard.py +0 -0
  54. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/deployer_pack.py +0 -0
  55. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/diff.py +0 -0
  56. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/export.py +0 -0
  57. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/halt.py +0 -0
  58. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/incident.py +0 -0
  59. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/instructions.py +0 -0
  60. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/interactive_init.py +0 -0
  61. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/oversight_log.py +0 -0
  62. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/portfolio.py +0 -0
  63. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/proposal.py +0 -0
  64. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/qms.py +0 -0
  65. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/rules.py +0 -0
  66. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/serve.py +0 -0
  67. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/snippet.py +0 -0
  68. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/verify.py +0 -0
  69. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/commands/verify_dossier.py +0 -0
  70. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/connectors/__init__.py +0 -0
  71. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/connectors/_check_args.py +0 -0
  72. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/connectors/github_actions.py +0 -0
  73. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/connectors/gitlab_ci.py +0 -0
  74. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/coverage_notice.py +0 -0
  75. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/exit_codes.py +0 -0
  76. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/inputs.py +0 -0
  77. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/leads.py +0 -0
  78. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/mapped_view.py +0 -0
  79. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/oidc_client.py +0 -0
  80. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/oversight_payload.py +0 -0
  81. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/proposal_gate.py +0 -0
  82. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/provenance.py +0 -0
  83. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/report_outputs.py +0 -0
  84. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/signing_identity.py +0 -0
  85. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/src/opencomplai_cli/summaries_emit.py +0 -0
  86. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/__init__.py +0 -0
  87. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/conftest.py +0 -0
  88. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/fixtures/agents/sample-manifest.json +0 -0
  89. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/fixtures/agents/sample-scan-report.json +0 -0
  90. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/fixtures/check_reports_artifact.json +0 -0
  91. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/fixtures/sarif-2.1.0.subset.schema.json +0 -0
  92. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/fixtures/trap/trap-manifest.json +0 -0
  93. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/check_reports.junit.xml +0 -0
  94. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/check_reports.sarif.json +0 -0
  95. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/check_reports.summary.md +0 -0
  96. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/golden/init_manifest.json +0 -0
  97. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_accept_cmd.py +0 -0
  98. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_agent_inventory_payload.py +0 -0
  99. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_agents_attest.py +0 -0
  100. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_agents_cmd.py +0 -0
  101. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_agents_expiry.py +0 -0
  102. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_agents_import_cmd.py +0 -0
  103. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_agents_verify_log.py +0 -0
  104. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_ai_docs_claims.py +0 -0
  105. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_ai_preload.py +0 -0
  106. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_ai_status.py +0 -0
  107. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_ai_status_cache.py +0 -0
  108. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_candidate_tier_invariants.py +0 -0
  109. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_changelog_newest_block.py +0 -0
  110. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_changelog_unreleased.py +0 -0
  111. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_acceptance.py +0 -0
  112. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_acceptance_matrix.py +0 -0
  113. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_accepted_real_rows.py +0 -0
  114. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_evidence_inputs.py +0 -0
  115. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_exemption_gate.py +0 -0
  116. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_output_dir.py +0 -0
  117. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_portfolio.py +0 -0
  118. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_proposal.py +0 -0
  119. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_report_exit_codes.py +0 -0
  120. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_reports.py +0 -0
  121. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_roles.py +0 -0
  122. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_sign_gate.py +0 -0
  123. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_signing.py +0 -0
  124. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_check_summaries.py +0 -0
  125. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_checker_cmd.py +0 -0
  126. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_ci_integration_guide.py +0 -0
  127. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_ci_recipes_guide.py +0 -0
  128. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_ci_templates.py +0 -0
  129. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_cli.py +0 -0
  130. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_connector_check_args.py +0 -0
  131. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_connectors.py +0 -0
  132. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_controls_cmd.py +0 -0
  133. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_controls_sync.py +0 -0
  134. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_dashboard_cmd.py +0 -0
  135. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_dead_code_nits.py +0 -0
  136. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_default_scan_coverage_notice.py +0 -0
  137. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_deployer_pack_cmd.py +0 -0
  138. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_diff_cmd.py +0 -0
  139. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_diff_tool_changes.py +0 -0
  140. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_anchors.py +0 -0
  141. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_closeout_guards.py +0 -0
  142. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_default_scan_coverage.py +0 -0
  143. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_generate_push.py +0 -0
  144. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_generate_render.py +0 -0
  145. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_generate_wiring.py +0 -0
  146. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_golive_wording.py +0 -0
  147. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_proposal_wording.py +0 -0
  148. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_python_snippets.py +0 -0
  149. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_release_notes_0130.py +0 -0
  150. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_signing_claims.py +0 -0
  151. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_docs_wording_guards.py +0 -0
  152. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_encoding.py +0 -0
  153. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_eu_ai_scan_golden.py +0 -0
  154. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_eval_provider_base_url.py +0 -0
  155. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_eval_seed_cmd.py +0 -0
  156. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_evidence_provenance.py +0 -0
  157. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_exit_codes.py +0 -0
  158. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_export_cmd.py +0 -0
  159. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_export_sign.py +0 -0
  160. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_fria_generate.py +0 -0
  161. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_gap_report_input.py +0 -0
  162. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_gaps_applicability.py +0 -0
  163. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_gaps_gpai.py +0 -0
  164. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_gaps_map_to.py +0 -0
  165. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_gaps_mapped_column.py +0 -0
  166. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_gate_demo.py +0 -0
  167. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_golden_eu_output.py +0 -0
  168. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_halt_wire.py +0 -0
  169. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_homebrew_formula.py +0 -0
  170. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_homebrew_release_script.py +0 -0
  171. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_incident_cmd.py +0 -0
  172. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_incident_log_cli.py +0 -0
  173. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_init_model_card.py +0 -0
  174. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_input_robustness.py +0 -0
  175. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_install_scripts.py +0 -0
  176. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_instructions_generate_cmd.py +0 -0
  177. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_iso_42001_target.py +0 -0
  178. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_leads_area_policy.py +0 -0
  179. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_no_direct_click.py +0 -0
  180. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_oidc_client.py +0 -0
  181. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_oss_sync_gates.py +0 -0
  182. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_oversight_log.py +0 -0
  183. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_oversight_payload.py +0 -0
  184. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_precommit_hooks_pin.py +0 -0
  185. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_proposal_gate_manifest.py +0 -0
  186. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_proposal_leads.py +0 -0
  187. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_proposal_leads_exit_neutrality.py +0 -0
  188. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_provenance_stamp.py +0 -0
  189. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_public_tree_safety.py +0 -0
  190. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_publish.py +0 -0
  191. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_push_cmd.py +0 -0
  192. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_push_cmd_dossier.py +0 -0
  193. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_qms_generate_cmd.py +0 -0
  194. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_qms_generate_manifest.py +0 -0
  195. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_qms_scaffold_cmd.py +0 -0
  196. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_readme_command_table.py +0 -0
  197. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_readme_quickstart_pin.py +0 -0
  198. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_recommend_gpai.py +0 -0
  199. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_recommend_qms_clauses.py +0 -0
  200. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_regulatory_timeline_cmd.py +0 -0
  201. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_report_files_keep_confirmed.py +0 -0
  202. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_rules_changelog_cmd.py +0 -0
  203. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_scan_candidates_render.py +0 -0
  204. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_scan_cmd.py +0 -0
  205. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_scan_import_candidates.py +0 -0
  206. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_scan_propose.py +0 -0
  207. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_scan_quick.py +0 -0
  208. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_scan_snippet_root.py +0 -0
  209. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_schema_violation_hint.py +0 -0
  210. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_security_claims.py +0 -0
  211. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_serve_docs.py +0 -0
  212. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_service_check.py +0 -0
  213. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_signing_secret_script.py +0 -0
  214. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_sort_priority.py +0 -0
  215. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_summaries_emit.py +0 -0
  216. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_validate_manifest_agents.py +0 -0
  217. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_validate_manifest_oversight.py +0 -0
  218. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_verify_cmd.py +0 -0
  219. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_verify_dossier_kind.py +0 -0
  220. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_verify_kinds.py +0 -0
  221. {opencomplai_cli-0.13.2 → opencomplai_cli-0.15.0}/tests/test_verify_sbom.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: opencomplai-cli
3
- Version: 0.13.2
3
+ Version: 0.15.0
4
4
  Summary: Opencomplai command-line interface for AI compliance: the EU AI Act, and NIST AI RMF derived from the same evidence
5
5
  Project-URL: Homepage, https://opencomplai.com
6
6
  Project-URL: Documentation, https://docs.opencomplai.com
@@ -9,21 +9,26 @@ Project-URL: Issues, https://github.com/Opencomplai/opencomplai/issues
9
9
  Project-URL: Changelog, https://github.com/Opencomplai/opencomplai/blob/main/CHANGELOG.md
10
10
  Author-email: Opencomplai <hello@opencomplai.com>
11
11
  License: AGPL-3.0-only
12
+ Keywords: ai-governance,ci-cd,cli,compliance-as-code,eu-ai-act,nist-ai-rmf,risk-assessment
12
13
  Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
13
15
  Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Information Technology
14
17
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3
15
18
  Classifier: Operating System :: OS Independent
16
19
  Classifier: Programming Language :: Python :: 3
17
20
  Classifier: Programming Language :: Python :: 3.11
18
21
  Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Security
19
23
  Classifier: Topic :: Software Development :: Quality Assurance
20
24
  Requires-Python: >=3.11
21
- Requires-Dist: opencomplai-core[reports]>=0.13.2
25
+ Requires-Dist: opencomplai-core[reports]>=0.15.0
22
26
  Requires-Dist: questionary>=2.0.0
23
27
  Requires-Dist: rich>=13.0.0
24
28
  Requires-Dist: typer>=0.9.0
25
29
  Provides-Extra: dev
26
30
  Requires-Dist: jsonschema>=4.21; extra == 'dev'
31
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
27
32
  Requires-Dist: pytest>=7.0; extra == 'dev'
28
33
  Requires-Dist: ruff>=0.1.0; extra == 'dev'
29
34
  Provides-Extra: serve
@@ -40,7 +45,7 @@ Description-Content-Type: text/markdown
40
45
  The `opencomplai` command-line tool for AI compliance assessment. It scans your
41
46
  repository, classifies your AI system against the EU AI Act, reports gaps for every
42
47
  framework your manifest targets (NIST AI RMF 1.0 is derived from the EU AI Act evidence),
43
- and produces an auditable, CI-gateable compliance artifact. EU AI Act evaluated; NIST AI RMF derived (partial, unreviewed); ISO 42001 native pack, attestation-led (partial, unreviewed); DORA and EBA mapped only.
48
+ and produces an auditable, CI-gateable compliance artifact. EU AI Act evaluated; NIST AI RMF derived per subcategory, attested where EU AI Act evidence is silent (unreviewed); ISO 42001, ISO 27090, ISO 27001, ISO 42005, ISO 23894, SOC 2, NIS2, DORA, EBA, EIOPA, GDPR, CRA and ETSI EN 304 223 native packs, attestation-led (unreviewed).
44
49
 
45
50
  Built on [`opencomplai-core`](https://pypi.org/project/opencomplai-core/) — the same
46
51
  deterministic, rule-based risk engine, with a rich terminal UX.
@@ -85,7 +90,8 @@ Also available as command groups (`opencomplai <group> --help` for their own sub
85
90
  `keys` (signing-key rotation), `ai` (optional AI-intent plugin configuration), `controls`
86
91
  (control-register status), `fria` (fundamental rights impact assessment), `qms` (Art. 17 quality-management-system documents), `dashboard` (Premium Dashboard connection management),
87
92
  `incident` (incident records and deadline clocks),
88
- `agents` (declared agent inventory: list, cross-check against a scan, report; `agents attest` signs an agent mandate attestation)
93
+ `agents` (declared agent inventory: list, cross-check against a scan, report; `agents attest` signs an agent mandate attestation),
94
+ `attestations` (`attestations pull` writes the attestation bundle `check --attestations-file` reads)
89
95
  and `rules` (rule-set history: `opencomplai rules changelog`).
90
96
  Per-command pages are at <https://docs.opencomplai.com/cli/>.
91
97
 
@@ -7,7 +7,7 @@
7
7
  The `opencomplai` command-line tool for AI compliance assessment. It scans your
8
8
  repository, classifies your AI system against the EU AI Act, reports gaps for every
9
9
  framework your manifest targets (NIST AI RMF 1.0 is derived from the EU AI Act evidence),
10
- and produces an auditable, CI-gateable compliance artifact. EU AI Act evaluated; NIST AI RMF derived (partial, unreviewed); ISO 42001 native pack, attestation-led (partial, unreviewed); DORA and EBA mapped only.
10
+ and produces an auditable, CI-gateable compliance artifact. EU AI Act evaluated; NIST AI RMF derived per subcategory, attested where EU AI Act evidence is silent (unreviewed); ISO 42001, ISO 27090, ISO 27001, ISO 42005, ISO 23894, SOC 2, NIS2, DORA, EBA, EIOPA, GDPR, CRA and ETSI EN 304 223 native packs, attestation-led (unreviewed).
11
11
 
12
12
  Built on [`opencomplai-core`](https://pypi.org/project/opencomplai-core/) — the same
13
13
  deterministic, rule-based risk engine, with a rich terminal UX.
@@ -52,7 +52,8 @@ Also available as command groups (`opencomplai <group> --help` for their own sub
52
52
  `keys` (signing-key rotation), `ai` (optional AI-intent plugin configuration), `controls`
53
53
  (control-register status), `fria` (fundamental rights impact assessment), `qms` (Art. 17 quality-management-system documents), `dashboard` (Premium Dashboard connection management),
54
54
  `incident` (incident records and deadline clocks),
55
- `agents` (declared agent inventory: list, cross-check against a scan, report; `agents attest` signs an agent mandate attestation)
55
+ `agents` (declared agent inventory: list, cross-check against a scan, report; `agents attest` signs an agent mandate attestation),
56
+ `attestations` (`attestations pull` writes the attestation bundle `check --attestations-file` reads)
56
57
  and `rules` (rule-set history: `opencomplai rules changelog`).
57
58
  Per-command pages are at <https://docs.opencomplai.com/cli/>.
58
59
 
@@ -1,23 +1,35 @@
1
1
  [project]
2
2
  name = "opencomplai-cli"
3
- version = "0.13.2"
3
+ version = "0.15.0"
4
4
  description = "Opencomplai command-line interface for AI compliance: the EU AI Act, and NIST AI RMF derived from the same evidence"
5
5
  readme = "README.md"
6
6
  license = { text = "AGPL-3.0-only" }
7
7
  authors = [{ name = "Opencomplai", email = "hello@opencomplai.com" }]
8
8
  requires-python = ">=3.11"
9
+ keywords = [
10
+ "ai-governance",
11
+ "ci-cd",
12
+ "cli",
13
+ "compliance-as-code",
14
+ "eu-ai-act",
15
+ "nist-ai-rmf",
16
+ "risk-assessment",
17
+ ]
9
18
  classifiers = [
10
19
  "Development Status :: 4 - Beta",
20
+ "Environment :: Console",
11
21
  "Intended Audience :: Developers",
22
+ "Intended Audience :: Information Technology",
12
23
  "License :: OSI Approved :: GNU Affero General Public License v3",
13
24
  "Operating System :: OS Independent",
14
25
  "Programming Language :: Python :: 3",
15
26
  "Programming Language :: Python :: 3.11",
16
27
  "Programming Language :: Python :: 3.12",
28
+ "Topic :: Security",
17
29
  "Topic :: Software Development :: Quality Assurance",
18
30
  ]
19
31
  dependencies = [
20
- "opencomplai-core[reports]>=0.13.2",
32
+ "opencomplai-core[reports]>=0.15.0",
21
33
  "typer>=0.9.0",
22
34
  "rich>=13.0.0",
23
35
  "questionary>=2.0.0",
@@ -42,6 +54,7 @@ opencomplai-gitlab-connector = "opencomplai_cli.connectors.gitlab_ci:main"
42
54
  [project.optional-dependencies]
43
55
  dev = [
44
56
  "pytest>=7.0",
57
+ "pytest-cov>=5.0.0",
45
58
  "ruff>=0.1.0",
46
59
  # Only used by test_publish.py's structural schema-validation test (an
47
60
  # end-to-end proof that the real repo-root compliance-artifact.json,
@@ -1,6 +1,6 @@
1
1
  """Opencomplai CLI."""
2
2
 
3
- __version__ = "0.13.2"
3
+ __version__ = "0.15.0"
4
4
 
5
5
  # Canonical project metadata — single source of truth for the `--version`
6
6
  # flag and the `opencomplai info` command. Mirrors the [project] table in
@@ -12,6 +12,7 @@ from __future__ import annotations
12
12
 
13
13
  import os
14
14
  import sys
15
+ from datetime import date
15
16
  from pathlib import Path
16
17
 
17
18
  import typer
@@ -77,6 +78,7 @@ def apply_acceptance_gate(
77
78
  scan_mode: str,
78
79
  corroboration_report=None,
79
80
  sample_set=None,
81
+ today: date | None = None,
80
82
  ) -> tuple[ScanStatusArtifact, bool]:
81
83
  """Return (artifact, halt_suppressed); see the module docstring."""
82
84
  valid, approved = _acceptance_state(manifest, change_context, repo_root)
@@ -124,6 +126,7 @@ def apply_acceptance_gate(
124
126
  corroboration_report=corroboration_report,
125
127
  eval_report=eval_report,
126
128
  repo_root=repo_root.resolve(),
129
+ today=today,
127
130
  )
128
131
  except ValueError as exc:
129
132
  typer.echo(f"Error: {exc}", err=True)
@@ -0,0 +1,394 @@
1
+ """Attestation bundles in the CLI: read one, merge it into the manifest, say what happened.
2
+
3
+ A bundle is a signed document of attestations and exclusions (see
4
+ `opencomplai_core.attestation_bundle`). It comes from a file, or from the endpoint
5
+ configured in `OPENCOMPLAI_DASHBOARD_URL` with the same `OPENCOMPLAI_API_KEY` that
6
+ `opencomplai push` uses. Both are opt-in: with neither a flag nor an
7
+ `opencomplai.yaml` `attestations` section, nothing is read and nothing is fetched.
8
+
9
+ The merge writes into a COPY of the manifest's `framework_inputs`, once, before
10
+ the first evaluation, so every command that evaluates frameworks sees it. The
11
+ manifest wins on the same requirement id. The CLI does not check the bundle's
12
+ signature (it holds no issuer key); it copies the hash and signature into the scan
13
+ artifact unchanged, and whoever receives the artifact can verify them.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ import json
19
+ import os
20
+ import re
21
+ import urllib.error
22
+ import urllib.request
23
+ from collections.abc import Callable, Mapping, Sequence
24
+ from dataclasses import dataclass
25
+ from datetime import date
26
+ from pathlib import Path
27
+ from urllib.parse import quote, urlparse
28
+
29
+ from opencomplai_core.attestation_bundle import AttestationBundle, bundle_ref
30
+ from opencomplai_core.frameworks import (
31
+ EU_AI_ACT,
32
+ FRAMEWORKS,
33
+ attestable_ids,
34
+ attestation_only_ids,
35
+ load_requirements_map,
36
+ )
37
+ from opencomplai_core.gap_report import stale_attestation_warnings
38
+ from opencomplai_core.models import (
39
+ AttestationBundleRef,
40
+ AttestationBundleUnavailable,
41
+ FrameworkInputs,
42
+ SystemManifest,
43
+ )
44
+ from opencomplai_core.project_config import ProjectConfig
45
+ from pydantic import ValidationError
46
+
47
+ # Importing publish installs the process-wide opener that never follows a
48
+ # redirect, so the API key is never replayed at another host.
49
+ from opencomplai_cli.publish import LOCAL_HOSTNAMES
50
+
51
+ #: The most a bundle may weigh, in a file and in an HTTP response, before it is parsed.
52
+ MAX_BUNDLE_BYTES = 2 * 1024 * 1024
53
+
54
+ _EU_PREFIX = f"{EU_AI_ACT}:"
55
+
56
+ # What can travel in an Authorization header: printable ASCII, no whitespace.
57
+ _SENDABLE_KEY = re.compile(r"[\x21-\x7e]+")
58
+
59
+ BundleStatus = AttestationBundleRef | AttestationBundleUnavailable
60
+
61
+
62
+ class AttestationError(ValueError):
63
+ """A bundle that cannot be used. `code` is the machine reason the scan artifact
64
+ records when the bundle was fetched (`^[a-z0-9_]{1,64}$`)."""
65
+
66
+ def __init__(self, code: str, message: str) -> None:
67
+ super().__init__(message)
68
+ self.code = code
69
+
70
+
71
+ @dataclass(frozen=True)
72
+ class Source:
73
+ """Where a run reads its bundle from: a file, or the configured endpoint."""
74
+
75
+ remote: bool
76
+ path: Path | None = None
77
+
78
+
79
+ def resolve_source(
80
+ file_flag: Path | None, remote_flag: bool, config: ProjectConfig
81
+ ) -> Source | None:
82
+ """The bundle source for a run, or None for the default offline run.
83
+
84
+ A flag beats `opencomplai.yaml`; the two flags together are a usage error.
85
+ """
86
+ if file_flag is not None and remote_flag:
87
+ raise ValueError("use --attestations-file or --attestations-remote, not both")
88
+ if file_flag is not None:
89
+ return Source(remote=False, path=file_flag)
90
+ if remote_flag:
91
+ return Source(remote=True)
92
+ if config.attestations_source == "remote":
93
+ return Source(remote=True)
94
+ if config.attestations_source == "file":
95
+ return Source(remote=False, path=config.attestations_path)
96
+ return None
97
+
98
+
99
+ def _parse_bundle(raw: bytes, origin: str) -> AttestationBundle:
100
+ if len(raw) > MAX_BUNDLE_BYTES:
101
+ raise AttestationError(
102
+ "bundle_too_large",
103
+ f"{origin} is larger than {MAX_BUNDLE_BYTES // 1024} KiB",
104
+ )
105
+ try:
106
+ data = json.loads(raw.decode("utf-8-sig"))
107
+ except (ValueError, RecursionError) as exc:
108
+ # JSONDecodeError and UnicodeDecodeError; RecursionError is a payload nested
109
+ # deeper than the parser allows, which the size cap does not bound.
110
+ raise AttestationError(
111
+ "invalid_bundle", f"{origin} is not valid JSON: {exc}"
112
+ ) from exc
113
+ try:
114
+ return AttestationBundle.model_validate(data)
115
+ except ValidationError as exc:
116
+ first = exc.errors()[0]
117
+ where = ".".join(str(part) for part in first["loc"]) or "bundle"
118
+ # `loc` and `msg` can quote text the bundle chose (a key, a bad date);
119
+ # ascii() keeps control characters out of the terminal.
120
+ detail = ascii(f"{where}: {first['msg']}")[1:-1]
121
+ raise AttestationError(
122
+ "invalid_bundle", f"{origin} is not a valid attestation bundle: {detail}"
123
+ ) from exc
124
+
125
+
126
+ def load_bundle_file(path: Path) -> AttestationBundle:
127
+ """Read and validate a bundle file. Raises AttestationError."""
128
+ try:
129
+ with path.open("rb") as handle:
130
+ raw = handle.read(MAX_BUNDLE_BYTES + 1)
131
+ except OSError as exc:
132
+ raise AttestationError(
133
+ "read_failed", f"could not read {path}: {exc.strerror or exc}"
134
+ ) from exc
135
+ return _parse_bundle(raw, str(path))
136
+
137
+
138
+ def bundle_url(base_url: str, system_id: str | None) -> str:
139
+ """`<base>/v1/attestations`, with `?system_id=` when a system is named.
140
+
141
+ Raises AttestationError for a scheme other than https, or http to a host that
142
+ is not this machine (push only warns about that; here the API key would
143
+ travel in clear, so it is an error).
144
+ """
145
+ base = base_url.rstrip("/")
146
+ invalid = AttestationError(
147
+ "invalid_url", "OPENCOMPLAI_DASHBOARD_URL must be an http(s) URL"
148
+ )
149
+ try:
150
+ parsed = urlparse(base)
151
+ hostname = parsed.hostname
152
+ except ValueError as exc: # e.g. an unterminated IPv6 bracket
153
+ raise invalid from exc
154
+ if parsed.scheme not in ("http", "https") or not hostname:
155
+ raise invalid
156
+ if parsed.scheme == "http" and hostname not in LOCAL_HOSTNAMES:
157
+ raise AttestationError(
158
+ "http_refused",
159
+ "OPENCOMPLAI_DASHBOARD_URL uses plain http to a remote host: the API key "
160
+ "would be sent unencrypted. Use https (plain http is accepted only for "
161
+ "localhost, 127.0.0.1 and ::1).",
162
+ )
163
+ query = f"?system_id={quote(system_id, safe='')}" if system_id else ""
164
+ return f"{base}/v1/attestations{query}"
165
+
166
+
167
+ def fetch_bundle(
168
+ base_url: str, api_key: str, system_id: str | None, *, timeout: int = 30
169
+ ) -> AttestationBundle:
170
+ """GET the bundle from `<base_url>/v1/attestations?system_id=<id>`.
171
+
172
+ Raises AttestationError. Nothing foreign is echoed: not the response body, and
173
+ not the text of an exception that could quote the key (a key with a newline in
174
+ it makes http.client put the whole header into its error).
175
+ """
176
+ if not _SENDABLE_KEY.fullmatch(api_key):
177
+ raise AttestationError(
178
+ "not_configured",
179
+ "OPENCOMPLAI_API_KEY contains characters that cannot be sent "
180
+ "(whitespace, a newline or non-ASCII); check how it is set",
181
+ )
182
+ request = urllib.request.Request(
183
+ bundle_url(base_url, system_id),
184
+ headers={"Authorization": f"Bearer {api_key}", "Accept": "application/json"},
185
+ method="GET",
186
+ )
187
+ try:
188
+ with urllib.request.urlopen(request, timeout=timeout) as response:
189
+ raw = response.read(MAX_BUNDLE_BYTES + 1)
190
+ except urllib.error.HTTPError as exc:
191
+ raise AttestationError(
192
+ "fetch_failed", f"the endpoint answered HTTP {exc.code}"
193
+ ) from exc
194
+ except OSError as exc: # URLError, DNS, refused connection, timeout, TLS
195
+ raise AttestationError(
196
+ "fetch_failed", f"could not reach the endpoint: {exc}"
197
+ ) from exc
198
+ except Exception as exc: # anything else: name the type only
199
+ raise AttestationError(
200
+ "fetch_failed",
201
+ f"could not reach the endpoint ({type(exc).__name__})",
202
+ ) from exc
203
+ return _parse_bundle(raw, "the endpoint's response")
204
+
205
+
206
+ def _check_system(bundle: AttestationBundle, system_id: str) -> None:
207
+ if bundle.system_id not in (None, system_id):
208
+ raise AttestationError(
209
+ "system_mismatch",
210
+ f"the bundle is for system {bundle.system_id!r}, not {system_id!r}",
211
+ )
212
+
213
+
214
+ def _engine_key(framework: str, requirement_id: str) -> str:
215
+ """The key `framework_inputs.<fw>.attested` uses. The EU AI Act spells its ids
216
+ without a prefix ("Art. 4"); a bundle may carry either form."""
217
+ if framework == EU_AI_ACT and requirement_id.startswith(_EU_PREFIX):
218
+ return requirement_id[len(_EU_PREFIX) :]
219
+ return requirement_id
220
+
221
+
222
+ def merge_into_manifest(
223
+ manifest: SystemManifest,
224
+ bundle: AttestationBundle,
225
+ targets: Sequence[str] | None = None,
226
+ ) -> tuple[SystemManifest, list[str], AttestationBundleRef]:
227
+ """A copy of `manifest` with the bundle's records in `framework_inputs`.
228
+
229
+ Returns (copy, warnings, the reference the scan artifact records). The manifest
230
+ wins on the same requirement id, with a warning for each bundle record or
231
+ exclusion it shadows. A framework the CLI does not know, and an id
232
+ that is not a requirement taking an attestation, is dropped with a warning; an
233
+ exclusion applies only to a row that an attestation alone decides, so the EU
234
+ AI Act (which takes no exclusions) and NIST AI RMF never get one. Frameworks the
235
+ run does not target are ignored (the EU AI Act is always evaluated). `targets`
236
+ None means every framework.
237
+ """
238
+ warnings: list[str] = []
239
+ wanted = None if targets is None else {*targets, EU_AI_ACT}
240
+ merged: dict[str, FrameworkInputs] = dict(manifest.framework_inputs)
241
+
242
+ for fw in sorted({*bundle.attestations, *bundle.excluded}):
243
+ if fw not in FRAMEWORKS:
244
+ warnings.append(f"the bundle names an unknown framework {fw!r}; ignored")
245
+ continue
246
+ if wanted is not None and fw not in wanted:
247
+ continue
248
+ own = manifest.framework_inputs.get(fw, FrameworkInputs())
249
+ attested = dict(own.attested)
250
+ excluded = dict(own.excluded)
251
+ decided = {*own.attested, *own.excluded} # the manifest wins on these
252
+ from_bundle: set[str] = set()
253
+
254
+ attestable = attestable_ids(fw)
255
+ for rid, record in sorted(bundle.attestations.get(fw, {}).items()):
256
+ key = _engine_key(fw, rid)
257
+ if key not in attestable:
258
+ warnings.append(
259
+ f"{rid!r} is not a {fw} requirement that takes an attestation; ignored"
260
+ )
261
+ elif key in from_bundle:
262
+ warnings.append(
263
+ f"{rid!r}: the bundle already has a record for {key!r}; "
264
+ "the first is kept"
265
+ )
266
+ elif key in decided:
267
+ warnings.append(
268
+ f"{rid!r}: the manifest already records {key!r}; "
269
+ f"the bundle's record {record.record_id} is not used"
270
+ )
271
+ else:
272
+ attested[key] = record.to_attestation()
273
+ from_bundle.add(key)
274
+
275
+ only = attestation_only_ids(fw)
276
+ for rid, reason in sorted(bundle.excluded.get(fw, {}).items()):
277
+ if fw == EU_AI_ACT:
278
+ warnings.append(f"{rid!r}: the EU AI Act takes no exclusions; ignored")
279
+ elif rid not in only:
280
+ warnings.append(
281
+ f"{rid!r} is not a {fw} row that only an attestation decides; "
282
+ "the exclusion is ignored"
283
+ )
284
+ elif rid in attested and rid not in own.attested:
285
+ warnings.append(
286
+ f"{rid!r} is both attested and excluded in the bundle; "
287
+ "the exclusion is ignored"
288
+ )
289
+ elif rid in decided:
290
+ warnings.append(
291
+ f"{rid!r}: the manifest already records this requirement; "
292
+ "the bundle's exclusion is not used"
293
+ )
294
+ else:
295
+ excluded[rid] = reason
296
+
297
+ if attested != own.attested or excluded != own.excluded:
298
+ merged[fw] = own.model_copy(
299
+ update={"attested": attested, "excluded": excluded}
300
+ )
301
+ return (
302
+ manifest.model_copy(update={"framework_inputs": merged}),
303
+ warnings,
304
+ bundle_ref(bundle),
305
+ )
306
+
307
+
308
+ def _requirements(framework: str) -> Mapping[str, object]:
309
+ pack = FRAMEWORKS.get(framework)
310
+ if pack is None or pack.requirements is None:
311
+ return {}
312
+ return load_requirements_map(pack.requirements)
313
+
314
+
315
+ def staleness_warnings(
316
+ manifest: SystemManifest, targets: Sequence[str], today: date
317
+ ) -> list[str]:
318
+ """Undated attestations older than their row's review period, for the
319
+ frameworks the run evaluates."""
320
+ out: list[str] = []
321
+ for fw in sorted({*targets, EU_AI_ACT}):
322
+ inputs = manifest.framework_inputs.get(fw)
323
+ if inputs is not None:
324
+ out.extend(
325
+ stale_attestation_warnings(inputs.attested, _requirements(fw), today)
326
+ )
327
+ return out
328
+
329
+
330
+ def load_for_run(
331
+ manifest: SystemManifest,
332
+ targets: Sequence[str],
333
+ *,
334
+ file_flag: Path | None,
335
+ remote_flag: bool,
336
+ config: ProjectConfig,
337
+ today: date,
338
+ warn: Callable[[str], None],
339
+ env: Mapping[str, str] | None = None,
340
+ ) -> tuple[SystemManifest, BundleStatus | None]:
341
+ """The manifest a run evaluates and what to record in the artifact.
342
+
343
+ Without a configured source this makes no network call and returns the manifest
344
+ untouched with None. A bundle file that cannot be used raises AttestationError
345
+ (the run should exit 2); an endpoint that cannot be used warns and the run goes
346
+ on with the manifest alone, recorded as `unavailable`.
347
+ """
348
+ source = resolve_source(file_flag, remote_flag, config)
349
+ status: BundleStatus | None = None
350
+ if source is not None:
351
+ try:
352
+ if source.remote:
353
+ bundle = fetch_from_env(manifest.system_id, env)
354
+ else:
355
+ if source.path is None:
356
+ raise AttestationError(
357
+ "read_failed", "attestations: source file needs a path"
358
+ )
359
+ bundle = load_bundle_file(source.path)
360
+ _check_system(bundle, manifest.system_id)
361
+ except AttestationError as exc:
362
+ if not source.remote:
363
+ raise
364
+ warn(f"attestation bundle unavailable ({exc.code}): {exc}")
365
+ status = AttestationBundleUnavailable(status="unavailable", reason=exc.code)
366
+ else:
367
+ manifest, merge_warnings, status = merge_into_manifest(
368
+ manifest, bundle, targets
369
+ )
370
+ for message in merge_warnings:
371
+ warn(message)
372
+ for message in staleness_warnings(manifest, targets, today):
373
+ warn(message)
374
+ return manifest, status
375
+
376
+
377
+ def fetch_from_env(
378
+ system_id: str | None, env: Mapping[str, str] | None = None
379
+ ) -> AttestationBundle:
380
+ """Fetch the bundle with the environment pair `push` uses (`os.environ` when `env`
381
+ is None). A bundle for another system than `system_id` is refused; with no
382
+ `system_id` the organisation-wide bundle is asked for and taken as it comes."""
383
+ environ = os.environ if env is None else env
384
+ api_key = environ.get("OPENCOMPLAI_API_KEY", "")
385
+ base_url = environ.get("OPENCOMPLAI_DASHBOARD_URL", "")
386
+ if not api_key or not base_url:
387
+ raise AttestationError(
388
+ "not_configured",
389
+ "OPENCOMPLAI_API_KEY and OPENCOMPLAI_DASHBOARD_URL must both be set",
390
+ )
391
+ bundle = fetch_bundle(base_url, api_key, system_id)
392
+ if system_id is not None:
393
+ _check_system(bundle, system_id)
394
+ return bundle
@@ -0,0 +1,81 @@
1
+ """CLI: ``opencomplai attestations pull``.
2
+
3
+ Fetches the attestation bundle from the endpoint configured in
4
+ ``OPENCOMPLAI_DASHBOARD_URL`` (with ``OPENCOMPLAI_API_KEY``, the pair
5
+ ``opencomplai push`` uses) and writes it to a file, so a CI job can run
6
+ ``check --attestations-file`` against a bundle it can pin and replay. Same exit
7
+ convention as ``push``: 0 on success, 3 otherwise; it never changes a gate.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import sys
13
+ from collections.abc import Mapping
14
+ from pathlib import Path
15
+
16
+ import typer
17
+ from rich.console import Console
18
+ from rich.markup import escape
19
+
20
+ from opencomplai_cli.attestations import AttestationError, fetch_from_env
21
+
22
+ console = Console()
23
+ err_console = Console(stderr=True)
24
+
25
+ EXIT_OK = 0
26
+ EXIT_PULL_FAILED = 3
27
+
28
+ app = typer.Typer(help="Attestation bundle commands.")
29
+
30
+
31
+ def run_pull(
32
+ output_file: Path,
33
+ system_id: str | None = None,
34
+ *,
35
+ env: Mapping[str, str] | None = None,
36
+ ) -> int:
37
+ """Fetch the bundle and write it to ``output_file`` as pretty JSON.
38
+
39
+ ``env`` defaults to ``os.environ``; tests pass a synthetic one.
40
+ """
41
+ try:
42
+ bundle = fetch_from_env(system_id, env)
43
+ output_file.parent.mkdir(parents=True, exist_ok=True)
44
+ output_file.write_text(
45
+ bundle.model_dump_json(indent=2) + "\n", encoding="utf-8"
46
+ )
47
+ except (AttestationError, OSError) as exc:
48
+ err_console.print(f"[red]Pull failed:[/red] {escape(str(exc))}")
49
+ return EXIT_PULL_FAILED
50
+ console.print(f"[green]Wrote {escape(str(output_file))}.[/green]")
51
+ console.print(f" records: {bundle.count}")
52
+ console.print(f" issued_at: {escape(bundle.issued_at)}")
53
+ return EXIT_OK
54
+
55
+
56
+ @app.command("pull")
57
+ def pull_cmd(
58
+ output_file: Path = typer.Option(
59
+ ...,
60
+ "--output",
61
+ "-o",
62
+ help="File to write the attestation bundle to (pretty-printed JSON).",
63
+ ),
64
+ system_id: str | None = typer.Option(
65
+ None,
66
+ "--system-id",
67
+ help=(
68
+ "System the bundle is for. Without it the bundle holds the "
69
+ "organisation-wide records only."
70
+ ),
71
+ ),
72
+ ) -> None:
73
+ """
74
+ Download the attestation bundle for a system and write it to a file.
75
+
76
+ Requires OPENCOMPLAI_API_KEY and OPENCOMPLAI_DASHBOARD_URL, the pair
77
+ `opencomplai push` uses. Plain http is refused for any host other than
78
+ localhost. Feed the file to `opencomplai check --attestations-file`. Exits 0
79
+ on success and 3 otherwise.
80
+ """
81
+ sys.exit(run_pull(output_file, system_id))
@@ -23,7 +23,10 @@ from opencomplai_core.compliance_checker import (
23
23
  render_pdf,
24
24
  )
25
25
  from opencomplai_core.compliance_checker.bridge import derogation_grounds
26
- from opencomplai_core.compliance_checker.catalog import load_help_content
26
+ from opencomplai_core.compliance_checker.catalog import (
27
+ load_help_content,
28
+ load_questions,
29
+ )
27
30
  from opencomplai_core.compliance_checker.merge import (
28
31
  MergedCheckerResult,
29
32
  merge_role_results,
@@ -270,6 +273,14 @@ def run_interactive_wizard(
270
273
  "Does the system require transparency obligations (chatbot, deepfake, synthetic content)?",
271
274
  default=False,
272
275
  )
276
+ if answers["r4_transparency"]:
277
+ answers["r4_transparency_items"] = [
278
+ value
279
+ for value, label in load_questions()["r4_transparency_items"][
280
+ "options"
281
+ ].items()
282
+ if _confirm(f"Art. 50: {label}?", default=False)
283
+ ]
273
284
 
274
285
  if entity == EntityType.DEPLOYER.value:
275
286
  answers["r5_fria"] = _confirm(