guardana-cli 1.0.2__tar.gz → 1.2.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.
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/PKG-INFO +4 -4
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/pyproject.toml +4 -4
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_reporting.py +11 -2
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/baseline.py +106 -16
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/import_observations.py +2 -1
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/new_pack.py +2 -2
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/pyproject.toml.tmpl +5 -6
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/test_manifest.py.tmpl +1 -1
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/test_rules_are_sampled.py.tmpl +1 -2
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/rule.py +11 -4
- guardana_cli-1.2.0/tests/test_baseline_written_on_windows.py +394 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_calibrate_cli.py +3 -2
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_collector_messages_are_sanitised_cli.py +4 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_deployment_declaration.py +4 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_installed_output_selection_cli.py +2 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_monitor_cli.py +4 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_new_pack.py +6 -4
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_pack_lock_cli.py +7 -2
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_reporter_wiring_cli.py +4 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_required_delivery_cli.py +82 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_rule_test_cli.py +18 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_run_cli.py +1 -1
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_scan_cli.py +34 -1
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_suite_cli.py +1 -1
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_trials_cli.py +1 -1
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_url_credentials_never_leave_the_run.py +2 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/.gitignore +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/LICENSE +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/README.md +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_a2a_run.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_artifact.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_atomic.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_budget_flags.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_connection.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_contracts.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_endpoint.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_errors.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_evaluators.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_exit.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_formats.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_mcp_run.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_output.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_outputs.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_plugins.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_probe_run.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_profile.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_profile_files.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_rules_loading.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_run_meta.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_safety_flags.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_sidecar.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_starter/README.md.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_starter/__init__.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_starter/codename.yaml.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_target_locator.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/_trace_input.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/analyze_trace.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/calibrate.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/case.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/config.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/diff.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/doctor.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/exit_codes.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/fixtures.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/grade.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/init.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/main.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/monitor.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/new_rule.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/__init__.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/agent_rule.yaml.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/manifest_header.yaml.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/package_init.py.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/prompt_rule.yaml.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/readme.md.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/scenario_rule.yaml.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/target.py.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/test_target.py.tmpl +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/plan.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/probe.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/py.typed +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/recipe.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/rules.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/run.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/scan.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/target.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/taxonomy.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/trace.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_a2a_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_a2a_probe_grades_only_replies_read_whole.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_a_custom_trace_target_records_its_document.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_a_new_static_finding_is_a_regression_in_any_file.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_a_non_finite_threshold_is_refused.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_a_provider_raising_system_exit_never_passes_a_scan.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_a_refused_write_leaves_no_staging_file.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_a_reporter_url_refusal_never_prints_the_password.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_a_short_evidence_bound_keeps_waivers_apart.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_adapter_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_an_admitted_plugin_raising_system_exit_never_exits_zero.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_an_evaluator_that_raises_is_named_by_calibrate.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_an_incomplete_saved_run_is_never_read_as_complete.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_an_mcp_pin_speaks_only_for_the_server_it_approved.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_an_mcp_pin_write_stays_inside_the_request_budget.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_an_undecided_anonymous_a2a_read_is_not_enforcement.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_an_unpinned_pack_never_hides_behind_a_locked_name.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_an_unreadable_judge_fails_closed.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_analyze_trace_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_analyze_trace_refuses_a_value_outside_the_schema.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_baseline_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_baseline_is_never_lost.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_baseline_needs_a_complete_run.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_baseline_waivers_survive_updates_and_need_a_reason.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_calibration_reaches_the_run.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_calibrations_resolve_beside_the_profile.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_canary_contract.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_case_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_contract_assertions_never_pass_an_unselected_record.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_contract_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_coverage_fingerprint.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_diff_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_diff_left_scan_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_diff_of_a_regrade_under_ip_redaction.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_docs_state_the_plugin_default.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_doctor_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_doctor_lists_installed_outputs.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_doctor_shows_what_packs_would_execute.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_documented_commands_exist.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_doubles_trace_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_entry_point_exit_codes.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_errors_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_evaluators_wiring.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_every_preset_is_named_in_help.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_exit_code_contract_everywhere.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_exit_code_table_without_click.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_exit_codes.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_fifo_inputs_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_fixtures_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_grade_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_grade_output_never_overwrites_a_suite_dataset.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_graded_share_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_guarded_probe_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_import_observations_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_init_starter.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_installed_output_delivery_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_invalid_judge_config.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_judge_calibration_prompt_version_warning.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_judge_usage_in_run.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_load_warnings_do_not_repeat_the_refusal_hint.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_manifest_records_its_limits.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_mcp_authorization_rules_never_pass_an_unread_server.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_mcp_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_mcp_probe_grades_the_live_manifest_a_client_adopts.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_mcp_probe_reads_every_authorization_server.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_metadata_only_waivers_stay_per_finding.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_monitor_redaction.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_new_rule_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_non_findings_formats.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_one_connection_builder.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_one_connection_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_output_encoding.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_output_flag.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_output_never_replaces_an_input.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_output_warns_about_format.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_pack_commands_account_for_outputs.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_pack_lock_registrants_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_pack_validate_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_plan_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_plan_mcp.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_plan_prices_judge_calls.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_plan_refuses_a_run_that_cannot_pass.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_plan_scan_prices_a_file_scan_at_zero.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_plugin_trust_default.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_plugin_trust_is_one_policy.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_probe_and_corpus_outputs_never_overwrite_an_input.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_probe_budget_spans_the_whole_run.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_probe_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_probe_fixtures_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_probe_flag_advice_leads_to_a_command_that_works.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_probe_http_client.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_probe_source_withholds_stdio_arguments.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_probe_sub_registry_keeps_load_state.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_probe_target_failure_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_profile_checks_read_the_files_it_names.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_profile_rule_paths_from_any_directory.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_published_outputs.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_python_facade_parity.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_readme_and_features_claims_hold.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_recipe_artifact.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_recipe_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_redaction_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_regression_regrade_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_release_audit_0_18_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_release_probe_of_a_chat_endpoint.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_report_sidecar_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_reporter_rejection.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_reporter_url_is_checked_first.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_request_rate_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_rule_test_sends_scripted_fixtures_only_to_the_profiles_judge.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_rules_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_runs_that_concluded_nothing_are_not_compared.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_safe_mode_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_saved_run_records_trust_and_scope.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_scan_builds_its_target_once.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_scan_pickle_bearing_names.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_scan_reads_every_string_of_an_mcp_manifest.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_suite_accounts_for_every_case.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_supply_chain_findings_survive_every_spelling.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_target_inspect_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_target_locator.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_taxonomy_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_trace_inspect_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_trace_reading_never_hides_a_lost_record.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_trace_rules_never_pass_an_uncompared_record.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_trace_rules_never_pass_late_or_unrecorded_authority.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_trace_shortfall_is_not_an_error.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_two_calibration_files_for_one_evaluator.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_unmatched_rule_includes_cli.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_usage_in_manifest.py +0 -0
- {guardana_cli-1.0.2 → guardana_cli-1.2.0}/tests/test_writing_rules_marks_the_surface.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: guardana-cli
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Guardana command-line interface: scan, probe, monitor, init, rules, new-rule.
|
|
5
5
|
Project-URL: Homepage, https://guardana.dev
|
|
6
6
|
Project-URL: Repository, https://github.com/guardana/guardana
|
|
@@ -21,9 +21,9 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
21
21
|
Classifier: Topic :: Security
|
|
22
22
|
Classifier: Typing :: Typed
|
|
23
23
|
Requires-Python: >=3.11
|
|
24
|
-
Requires-Dist: guardana-core==1.0
|
|
25
|
-
Requires-Dist: guardana-report==1.0
|
|
26
|
-
Requires-Dist: guardana-rules==1.0
|
|
24
|
+
Requires-Dist: guardana-core==1.2.0
|
|
25
|
+
Requires-Dist: guardana-report==1.2.0
|
|
26
|
+
Requires-Dist: guardana-rules==1.2.0
|
|
27
27
|
Requires-Dist: pyyaml>=6.0
|
|
28
28
|
Requires-Dist: typer>=0.27.3
|
|
29
29
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "guardana-cli"
|
|
3
|
-
version = "1.0
|
|
3
|
+
version = "1.2.0"
|
|
4
4
|
description = "Guardana command-line interface: scan, probe, monitor, init, rules, new-rule."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -42,9 +42,9 @@ classifiers = [
|
|
|
42
42
|
# only there transitively is one a dependant can remove without anybody noticing
|
|
43
43
|
# until a clean install fails.
|
|
44
44
|
dependencies = [
|
|
45
|
-
"guardana-core==1.0
|
|
46
|
-
"guardana-rules==1.0
|
|
47
|
-
"guardana-report==1.0
|
|
45
|
+
"guardana-core==1.2.0",
|
|
46
|
+
"guardana-rules==1.2.0",
|
|
47
|
+
"guardana-report==1.2.0",
|
|
48
48
|
"typer>=0.27.3",
|
|
49
49
|
"pyyaml>=6.0",
|
|
50
50
|
]
|
|
@@ -133,7 +133,8 @@ def submit_safely( # noqa: PLR0913 — a destination, a run, and whether it mus
|
|
|
133
133
|
with what it said sanitised: the collector token withheld, secrets redacted, control
|
|
134
134
|
characters dropped;
|
|
135
135
|
the caller decides the exit, since the scan already ran and its verdict stands on its
|
|
136
|
-
own. A
|
|
136
|
+
own. A retry the collector accepted without comparing it is delivered, and said as a
|
|
137
|
+
warning. A bad `--reporter` URL or a bug in serialization is not an outage; those
|
|
137
138
|
propagate so the user actually learns their findings are not being collected.
|
|
138
139
|
"""
|
|
139
140
|
level, suffix = (
|
|
@@ -143,8 +144,9 @@ def submit_safely( # noqa: PLR0913 — a destination, a run, and whether it mus
|
|
|
143
144
|
# sent or carry escape sequences, so it is printed only once sanitised.
|
|
144
145
|
token = os.environ.get(TOKEN_VARIABLE)
|
|
145
146
|
secrets = (token,) if token else ()
|
|
147
|
+
reporter = reporter_from_url(url, deployment, run)
|
|
146
148
|
try:
|
|
147
|
-
|
|
149
|
+
reporter.submit(result, source=source)
|
|
148
150
|
except HTTPError as exc:
|
|
149
151
|
# A rejected envelope is not an outage — swallowing it as "unreachable" is
|
|
150
152
|
# how a whole fleet can stop reporting while the dashboard keeps showing
|
|
@@ -165,4 +167,11 @@ def submit_safely( # noqa: PLR0913 — a destination, a run, and whether it mus
|
|
|
165
167
|
err=True,
|
|
166
168
|
)
|
|
167
169
|
return False
|
|
170
|
+
if reporter.accepted_uncompared:
|
|
171
|
+
named = f"run {run.run_id}" if run is not None else "this run"
|
|
172
|
+
typer.echo(
|
|
173
|
+
f"warning: the collector accepted {named} as a retry without comparing it: the run "
|
|
174
|
+
f"it holds predates content digests, so different content would not be noticed",
|
|
175
|
+
err=True,
|
|
176
|
+
)
|
|
168
177
|
return True
|
|
@@ -34,7 +34,14 @@ from guardana.core.report import (
|
|
|
34
34
|
serialize_baseline,
|
|
35
35
|
split_ref,
|
|
36
36
|
)
|
|
37
|
-
from guardana.core.report.baseline import
|
|
37
|
+
from guardana.core.report.baseline import (
|
|
38
|
+
BASELINE_VERSION,
|
|
39
|
+
Baseline,
|
|
40
|
+
Waiver,
|
|
41
|
+
apply_baseline,
|
|
42
|
+
read_baseline,
|
|
43
|
+
windows_fingerprint,
|
|
44
|
+
)
|
|
38
45
|
from guardana.core.report.load import ReportLoadError, load_report
|
|
39
46
|
from guardana.core.runner import Runner
|
|
40
47
|
from guardana.core.target import ArtifactTarget, TargetKind
|
|
@@ -334,20 +341,30 @@ def update( # noqa: PLR0913, PLR0917 — one typer.Option per CLI flag; this is
|
|
|
334
341
|
# waiver together with the reason and the approver a person wrote.
|
|
335
342
|
refuse_an_incomplete_baseline(result, prof.policy, file)
|
|
336
343
|
current = {f.fingerprint for f in result.findings}
|
|
344
|
+
waivers, merged = _one_per_finding(baseline.waivers, result, current)
|
|
337
345
|
unexamined = {
|
|
338
346
|
w.fingerprint: why
|
|
339
|
-
for w in
|
|
347
|
+
for w in waivers
|
|
340
348
|
if w.fingerprint not in current and (why := _not_examined(w, result, path)) is not None
|
|
341
349
|
}
|
|
342
|
-
kept = [w for w in
|
|
343
|
-
dropped = [w for w in
|
|
344
|
-
_write_waivers(
|
|
350
|
+
kept = [w for w in waivers if w.fingerprint in current or w.fingerprint in unexamined]
|
|
351
|
+
dropped = [w for w in waivers if w not in kept]
|
|
352
|
+
_write_waivers(
|
|
353
|
+
file,
|
|
354
|
+
kept,
|
|
355
|
+
baseline.version if any(w.legacy_path for w in kept) else BASELINE_VERSION,
|
|
356
|
+
)
|
|
345
357
|
for waiver in kept:
|
|
346
358
|
if waiver.fingerprint in unexamined:
|
|
347
359
|
typer.echo(
|
|
348
360
|
f"kept: {waiver.fingerprint} ({waiver.rule or 'unknown rule'}) — "
|
|
349
361
|
f"{unexamined[waiver.fingerprint]}, so whether it is fixed is unknown"
|
|
350
362
|
)
|
|
363
|
+
for waiver in merged:
|
|
364
|
+
typer.echo(
|
|
365
|
+
f"removed: {waiver.fingerprint} ({waiver.rule or 'unknown rule'}) waives a finding "
|
|
366
|
+
f"another waiver in this file already waives"
|
|
367
|
+
)
|
|
351
368
|
for waiver in dropped:
|
|
352
369
|
gone = _deleted_from(waiver, path)
|
|
353
370
|
typer.echo(
|
|
@@ -356,14 +373,82 @@ def update( # noqa: PLR0913, PLR0917 — one typer.Option per CLI flag; this is
|
|
|
356
373
|
if gone is not None
|
|
357
374
|
else f"removed: {waiver.fingerprint} ({waiver.rule or 'unknown rule'}) is fixed"
|
|
358
375
|
)
|
|
359
|
-
|
|
360
|
-
unwaived =
|
|
376
|
+
remaining = replace(baseline, waivers=tuple(kept))
|
|
377
|
+
unwaived = apply_baseline(result, remaining.active(), remaining.active_legacy()).findings
|
|
361
378
|
typer.echo(
|
|
362
|
-
f"{len(kept)} waiver(s) kept, {len(dropped)
|
|
379
|
+
f"{len(kept)} waiver(s) kept, {len(dropped) + len(merged)} removed, "
|
|
380
|
+
f"{len(unexamined)} of the kept "
|
|
363
381
|
f"not re-examined. {len(unwaived)} finding(s) are not waived by this file."
|
|
364
382
|
)
|
|
365
383
|
|
|
366
384
|
|
|
385
|
+
def _one_per_finding(
|
|
386
|
+
waivers: Sequence[Waiver], result: ScanResult, current: set[str]
|
|
387
|
+
) -> tuple[list[Waiver], list[Waiver]]:
|
|
388
|
+
"""Rewrite each Windows waiver, and set aside one that lands on a finding already waived.
|
|
389
|
+
|
|
390
|
+
A file used on two platforms can hold a waiver for one finding from each. Only a
|
|
391
|
+
rewritten waiver can be set aside, and only for one still active, so a merge never
|
|
392
|
+
starts failing a waived finding and never touches what was written for that finding.
|
|
393
|
+
"""
|
|
394
|
+
today = datetime.now(UTC).date()
|
|
395
|
+
pairs = [(waiver, _respelled(waiver, result, current)) for waiver in waivers]
|
|
396
|
+
active: set[str] = set()
|
|
397
|
+
landed: dict[str, tuple[Waiver, Waiver]] = {}
|
|
398
|
+
for pair in pairs:
|
|
399
|
+
waiver, rewritten = pair
|
|
400
|
+
if rewritten.fingerprint == waiver.fingerprint:
|
|
401
|
+
if not rewritten.is_expired(today):
|
|
402
|
+
active.add(rewritten.fingerprint)
|
|
403
|
+
continue
|
|
404
|
+
held = landed.get(rewritten.fingerprint)
|
|
405
|
+
if held is None or (held[1].is_expired(today) and not rewritten.is_expired(today)):
|
|
406
|
+
landed[rewritten.fingerprint] = pair
|
|
407
|
+
kept: list[Waiver] = []
|
|
408
|
+
merged: list[Waiver] = []
|
|
409
|
+
for pair in pairs:
|
|
410
|
+
waiver, rewritten = pair
|
|
411
|
+
fingerprint = rewritten.fingerprint
|
|
412
|
+
if fingerprint == waiver.fingerprint or (
|
|
413
|
+
landed[fingerprint] is pair and fingerprint not in active
|
|
414
|
+
):
|
|
415
|
+
kept.append(rewritten)
|
|
416
|
+
else:
|
|
417
|
+
merged.append(waiver)
|
|
418
|
+
return kept, merged
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
def _respelled(waiver: Waiver, result: ScanResult, current: set[str]) -> Waiver:
|
|
422
|
+
r"""Rewrite a Windows waiver an older version wrote with the finding it still waives.
|
|
423
|
+
|
|
424
|
+
The finding's own fingerprint and location replace the ones hashed over `\`, so the
|
|
425
|
+
file can be written as the current version; the reason, approver and expiry stay. A
|
|
426
|
+
finding carrying the waiver's own fingerprint means no rewrite is needed: its `\` is
|
|
427
|
+
part of a file name on Linux or macOS.
|
|
428
|
+
"""
|
|
429
|
+
if not waiver.legacy_path:
|
|
430
|
+
return waiver
|
|
431
|
+
if waiver.fingerprint in current:
|
|
432
|
+
return replace(waiver, legacy_path=False)
|
|
433
|
+
match = next((f for f in result.findings if windows_fingerprint(f) == waiver.fingerprint), None)
|
|
434
|
+
if match is None:
|
|
435
|
+
return waiver
|
|
436
|
+
return replace(
|
|
437
|
+
waiver, fingerprint=match.fingerprint, location=match.target_ref, legacy_path=False
|
|
438
|
+
)
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
def _locations(waiver: Waiver) -> list[str]:
|
|
442
|
+
r"""Return where `waiver` may point: as written, and with `/` when Windows may have written it.
|
|
443
|
+
|
|
444
|
+
The spelling with `/` comes first, the one a report names. On Linux or macOS a `\` can
|
|
445
|
+
be part of the file's name, so the location as written is still a candidate.
|
|
446
|
+
"""
|
|
447
|
+
if not waiver.legacy_path:
|
|
448
|
+
return [waiver.location]
|
|
449
|
+
return [waiver.location.replace("\\", "/"), waiver.location]
|
|
450
|
+
|
|
451
|
+
|
|
367
452
|
def _not_examined(waiver: Waiver, result: ScanResult, root: Path | None) -> str | None:
|
|
368
453
|
"""Say why `result` could not have reported `waiver`'s finding, or None when it could.
|
|
369
454
|
|
|
@@ -375,14 +460,13 @@ def _not_examined(waiver: Waiver, result: ScanResult, root: Path | None) -> str
|
|
|
375
460
|
return f"{waiver.rule} did not run"
|
|
376
461
|
if result.scope is None or not waiver.location:
|
|
377
462
|
return None
|
|
378
|
-
|
|
379
|
-
head = path.split("#", 1)[0]
|
|
463
|
+
heads = [split_ref(location)[0].split("#", 1)[0] for location in _locations(waiver)]
|
|
380
464
|
listed = set(result.scope.files)
|
|
381
|
-
if head in listed or head.rsplit(":", 1)[0] in listed:
|
|
465
|
+
if any(head in listed or head.rsplit(":", 1)[0] in listed for head in heads):
|
|
382
466
|
return None
|
|
383
467
|
if _deleted_from(waiver, root) is not None:
|
|
384
468
|
return None
|
|
385
|
-
return f"this run did not list {
|
|
469
|
+
return f"this run did not list {heads[0]}"
|
|
386
470
|
|
|
387
471
|
|
|
388
472
|
def _deleted_from(waiver: Waiver, root: Path | None) -> str | None:
|
|
@@ -395,7 +479,9 @@ def _deleted_from(waiver: Waiver, root: Path | None) -> str | None:
|
|
|
395
479
|
"""
|
|
396
480
|
if root is None or not waiver.location or "#" in waiver.location:
|
|
397
481
|
return None
|
|
398
|
-
|
|
482
|
+
# Only the first spelling can prove a file gone: where `\\` is no separator, the name a
|
|
483
|
+
# Windows build wrote is missing whether or not the file it means is there.
|
|
484
|
+
path, _line = split_ref(_locations(waiver)[0])
|
|
399
485
|
try:
|
|
400
486
|
base = Path.cwd().resolve()
|
|
401
487
|
top = root.resolve()
|
|
@@ -440,9 +526,13 @@ def _missing_under(candidate: Path, top: Path) -> bool:
|
|
|
440
526
|
return False
|
|
441
527
|
|
|
442
528
|
|
|
443
|
-
def _write_waivers(file: Path, waivers: Sequence[Waiver]) -> None:
|
|
529
|
+
def _write_waivers(file: Path, waivers: Sequence[Waiver], version: int) -> None:
|
|
530
|
+
r"""Write `waivers` as a baseline of `version`.
|
|
531
|
+
|
|
532
|
+
A waiver Windows wrote with `\` that could not be rewritten keeps its file's own
|
|
533
|
+
version, since only a version before 3 reads its fingerprint the Windows way.
|
|
534
|
+
"""
|
|
444
535
|
import yaml # noqa: PLC0415
|
|
445
|
-
from guardana.core.report.baseline import BASELINE_VERSION # noqa: PLC0415
|
|
446
536
|
|
|
447
537
|
body = [
|
|
448
538
|
{
|
|
@@ -456,7 +546,7 @@ def _write_waivers(file: Path, waivers: Sequence[Waiver]) -> None:
|
|
|
456
546
|
for w in waivers
|
|
457
547
|
]
|
|
458
548
|
_write_whole_or_exit(
|
|
459
|
-
file, yaml.safe_dump({"version":
|
|
549
|
+
file, yaml.safe_dump({"version": version, "waivers": body}, sort_keys=False)
|
|
460
550
|
)
|
|
461
551
|
|
|
462
552
|
|
|
@@ -29,6 +29,7 @@ from guardana.cli._sidecar import (
|
|
|
29
29
|
refuse_writing_over_named_inputs,
|
|
30
30
|
)
|
|
31
31
|
from guardana.cli.exit_codes import ExitCode
|
|
32
|
+
from guardana.core._path_spelling import portable_ref
|
|
32
33
|
from guardana.core.gate import gate_outcome
|
|
33
34
|
from guardana.core.manifest import SourceKind, TargetIdentity
|
|
34
35
|
from guardana.core.plugins import PluginMode, PluginTrust
|
|
@@ -99,7 +100,7 @@ def import_observations( # noqa: PLR0913, PLR0917 — one typer.Option per CLI
|
|
|
99
100
|
warn_without_a_reporter(prof.delivery_required, reporter)
|
|
100
101
|
read = _read_or_exit(results, producer)
|
|
101
102
|
started_at = datetime.now(UTC)
|
|
102
|
-
reference = target or f"{read.provenance.producer}:{results}"
|
|
103
|
+
reference = target or f"{read.provenance.producer}:{portable_ref(str(results))}"
|
|
103
104
|
result = ScanResult(
|
|
104
105
|
findings=(),
|
|
105
106
|
rules_run=(),
|
|
@@ -75,7 +75,7 @@ class _Names:
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
def _core_range(version: str) -> tuple[str, str]:
|
|
78
|
-
"""Return the `guardana-core` this pack is made with and the next
|
|
78
|
+
"""Return the `guardana-core` this pack is made with and the next major it stops before.
|
|
79
79
|
|
|
80
80
|
The local label is dropped: a requirement may not name one.
|
|
81
81
|
"""
|
|
@@ -83,7 +83,7 @@ def _core_range(version: str) -> tuple[str, str]:
|
|
|
83
83
|
release = re.match(r"(\d+)\.(\d+)", public)
|
|
84
84
|
if release is None:
|
|
85
85
|
raise ValueError(f"guardana-core reports a version that is not PEP 440: {version!r}")
|
|
86
|
-
return public,
|
|
86
|
+
return public, str(int(release[1]) + 1)
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
def _refuse(message: str) -> typer.Exit:
|
{guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/pyproject.toml.tmpl
RENAMED
|
@@ -5,12 +5,11 @@ description = "Guardana rules and a target for __DIST__."
|
|
|
5
5
|
requires-python = ">=3.11"
|
|
6
6
|
classifiers = ["Typing :: Typed"]
|
|
7
7
|
# `guardana-core` is all a pack imports: the evaluators its rules name and the
|
|
8
|
-
# taxonomy catalogues their references resolve against live there. It is held
|
|
9
|
-
# the
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
# something this package imports.
|
|
8
|
+
# taxonomy catalogues their references resolve against live there. It is held from
|
|
9
|
+
# the release this pack was made with up to the next major, because everything the
|
|
10
|
+
# pack imports is in the supported surface, which changes incompatibly only in a
|
|
11
|
+
# major release. The commands that verify this pack ship in `guardana-cli`, which
|
|
12
|
+
# is the `guardana` you already run — a tool, not something this package imports.
|
|
14
13
|
dependencies = ["guardana-core>=__CORE_FLOOR__,<__CORE_CEILING__"]
|
|
15
14
|
|
|
16
15
|
[project.entry-points."guardana.rules"]
|
{guardana_cli-1.0.2 → guardana_cli-1.2.0}/src/guardana/cli/pack_templates/test_manifest.py.tmpl
RENAMED
|
@@ -15,8 +15,8 @@ from guardana.core.pack import (
|
|
|
15
15
|
installed_manifests,
|
|
16
16
|
load_manifest,
|
|
17
17
|
)
|
|
18
|
+
from guardana.core import Registry
|
|
18
19
|
from guardana.core.plugins import PluginMode, PluginTrust
|
|
19
|
-
from guardana.core.registry import Registry
|
|
20
20
|
from guardana.core.taxonomy import register_all
|
|
21
21
|
|
|
22
22
|
_THIS_PACK = PluginTrust(mode=PluginMode.ALLOWLIST, allowed=frozenset({"__DIST__"}))
|
|
@@ -6,9 +6,8 @@ tool is built around. `guardana rule test "__PREFIX__.*" --plugins allowlist
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import __MODULE__
|
|
9
|
+
from guardana.core import Registry, RuleContext
|
|
9
10
|
from guardana.core.plugins import PluginMode, PluginTrust
|
|
10
|
-
from guardana.core.registry import Registry
|
|
11
|
-
from guardana.core.rule import RuleContext
|
|
12
11
|
from guardana.core.rule.verify import verify_rules
|
|
13
12
|
from guardana.core.taxonomy import register_all
|
|
14
13
|
|
|
@@ -214,6 +214,7 @@ _LEFT_OUT = (
|
|
|
214
214
|
"from a suite (its outcome is a pass rate, not one reply's label)",
|
|
215
215
|
"inconclusive (no measurable label)",
|
|
216
216
|
"not offered (the sample lacks what the rule examines)",
|
|
217
|
+
"not applicable (the sample holds nothing the rule grades)",
|
|
217
218
|
"artifact or trace sample(s) (the corpus holds model replies only)",
|
|
218
219
|
"from a rule that declares no expectation or more than one",
|
|
219
220
|
"not a single scripted reply (a conversation or an agent run)",
|
|
@@ -224,6 +225,7 @@ _LEFT_OUT = (
|
|
|
224
225
|
_SUITE,
|
|
225
226
|
_INCONCLUSIVE,
|
|
226
227
|
_NOT_OFFERED,
|
|
228
|
+
_NOT_APPLICABLE,
|
|
227
229
|
_NO_REPLY_KIND,
|
|
228
230
|
_NOT_ONE_EXPECTATION,
|
|
229
231
|
_NOT_ONE_REPLY,
|
|
@@ -231,6 +233,12 @@ _LEFT_OUT = (
|
|
|
231
233
|
_NOTHING_SENT,
|
|
232
234
|
) = _LEFT_OUT
|
|
233
235
|
_NO_REPLY_KINDS = frozenset({TargetKind.ARTIFACT, TargetKind.TRACE})
|
|
236
|
+
_NO_LABEL = {
|
|
237
|
+
FixtureOutcome.INCONCLUSIVE: _INCONCLUSIVE,
|
|
238
|
+
FixtureOutcome.NOT_OFFERED: _NOT_OFFERED,
|
|
239
|
+
FixtureOutcome.NOT_APPLICABLE: _NOT_APPLICABLE,
|
|
240
|
+
}
|
|
241
|
+
"""The declared outcomes no measurable label follows from."""
|
|
234
242
|
|
|
235
243
|
|
|
236
244
|
def _write_corpus(
|
|
@@ -293,10 +301,9 @@ def _unlabelled(rule: Rule, fixture: RuleFixture, expectations: tuple[object, ..
|
|
|
293
301
|
"""Why this fixture cannot become a corpus row, or None when it still might."""
|
|
294
302
|
if isinstance(rule, SuiteRule):
|
|
295
303
|
return _SUITE
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
return _NOT_OFFERED
|
|
304
|
+
unlabelled = _NO_LABEL.get(fixture.outcome)
|
|
305
|
+
if unlabelled is not None:
|
|
306
|
+
return unlabelled
|
|
300
307
|
if fixture.target.kind in _NO_REPLY_KINDS:
|
|
301
308
|
return _NO_REPLY_KIND
|
|
302
309
|
if len(expectations) != 1:
|