diff --git a/docs/ci/runtime_intelligence_gitlab_artifacts.md b/docs/ci/runtime_intelligence_gitlab_artifacts.md index 9095c25..5176bd2 100644 --- a/docs/ci/runtime_intelligence_gitlab_artifacts.md +++ b/docs/ci/runtime_intelligence_gitlab_artifacts.md @@ -208,6 +208,10 @@ The handoff gate also compares Orchestrator operation risk rollup and operation timeline summary run IDs against the preserved EdgeEnv regression context, so compact AIGuard operation evidence remains traceable to producer-side Orchestrator context. +It additionally requires AIGuard's EdgeEnv handoff alignment artifact to carry +matching policy-pressure summary run IDs from the EdgeEnv handoff and the +`guard_analysis` raw context, keeping policy-pressure review evidence tied back +to the same candidate run without moving deployment ownership away from Lab. The artifact gate is implemented by `scripts/check_runtime_intelligence_artifact_bundle.py`. It checks the generated Markdown / HTML report for the required Runtime Intelligence rows, including the short `Review Path` section, the `Review path` note, the `Reviewer Focus` quick-scan table, Lab ownership, EdgeEnv comparability, `EdgeEnv fixture matrix coverage`, telemetry coverage-gap markers, Runtime replay duration scope with `source=entrypoint_requested_frames` traceability, Orchestrator operation feed context, the Lab-owned `Reviewer operation quick scan` row, compact queue/deadline/fallback operation markers with `max_total_queue_depth`, AIGuard max queue raw-context traceability, Orchestrator task event rollup, Lab EdgeEnv preservation context, Jetson/device-local preservation identity and detail labels, Orchestrator `operation_risk_summary` navigation context, AIGuard runtime operation anomalies, AIGuard `edgeenv_orchestrator_operation_risk_summary` evidence, AIGuard `edgeenv_orchestrator_operation_risk_rollup` evidence, AIGuard `edgeenv_orchestrator_task_event_rollup` evidence, AIGuard `edgeenv_orchestrator_operation_timeline_summary` evidence, AIGuard `edgeenv_orchestrator_scheduler_fairness_summary` evidence, AIGuard `edgeenv_orchestrator_policy_pressure_summary` evidence, remote dispatch starter event summary, `Remote fallback starter evidence`, `edgeenv_orchestrator_producer_lineage`, `runtime_history_seed_run_config_traceability`, `remote_execution_recovered_by_fallback`, and triggered deployment review rules. diff --git a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json index db58a6b..c6d6c7f 100644 --- a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json @@ -99,6 +99,13 @@ "edgeenv-smoke-candidate", "edgeenv-smoke-missing" ], + "handoff_policy_pressure_summary_run_ids": [ + "edgeenv-smoke-candidate" + ], + "guard_analysis_policy_pressure_summary_run_ids": [ + "edgeenv-smoke-candidate" + ], + "policy_pressure_summary_errors": [], "guard_alignment_summary_errors": [], "errors": [] } diff --git a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md index 4316299..1754e8b 100644 --- a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md @@ -59,4 +59,6 @@ InferEdgeAIGuard EdgeEnv handoff alignment summary - supplemental_guard_evidence_types: [edgeenv_orchestrator_operation_risk_summary] - handoff_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing] - guard_analysis_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing] +- handoff_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate] +- guard_analysis_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate] ``` diff --git a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.json b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.json index bbc6e6f..3064c06 100644 --- a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.json +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.json @@ -124,6 +124,13 @@ "edgeenv-smoke-candidate", "edgeenv-smoke-missing" ], + "handoff_policy_pressure_summary_run_ids": [ + "edgeenv-smoke-candidate" + ], + "guard_analysis_policy_pressure_summary_run_ids": [ + "edgeenv-smoke-candidate" + ], + "policy_pressure_summary_errors": [], "guard_alignment_summary_errors": [], "errors": [] } diff --git a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.md b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.md index 3128286..ffe8282 100644 --- a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.md +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.md @@ -63,4 +63,6 @@ InferEdgeAIGuard EdgeEnv handoff alignment summary - supplemental_guard_evidence_types: [edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_stale_drop_summary, stale_frame_risk] - handoff_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing] - guard_analysis_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing] +- handoff_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate] +- guard_analysis_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate] ``` diff --git a/scripts/check_runtime_intelligence_ci_artifacts.py b/scripts/check_runtime_intelligence_ci_artifacts.py index 0becf02..7371586 100644 --- a/scripts/check_runtime_intelligence_ci_artifacts.py +++ b/scripts/check_runtime_intelligence_ci_artifacts.py @@ -107,6 +107,9 @@ "edgeenv-smoke-candidate", "edgeenv-smoke-missing", ] +REQUIRED_AIGUARD_POLICY_PRESSURE_RUN_IDS = [ + "edgeenv-smoke-candidate", +] REQUIRED_AIGUARD_OPTIONAL_EVIDENCE_TYPES = [ "stale_frame_risk", "edgeenv_orchestrator_stale_drop_summary", @@ -510,6 +513,23 @@ def _validate_aiguard_handoff_alignment( errors, "AIGuard alignment guard_analysis run IDs must match EdgeEnv summary", ) + _record( + payload.get("handoff_policy_pressure_summary_run_ids") + == REQUIRED_AIGUARD_POLICY_PRESSURE_RUN_IDS, + errors, + "AIGuard alignment handoff policy-pressure run IDs must match EdgeEnv summary", + ) + _record( + payload.get("guard_analysis_policy_pressure_summary_run_ids") + == REQUIRED_AIGUARD_POLICY_PRESSURE_RUN_IDS, + errors, + "AIGuard alignment guard_analysis policy-pressure run IDs must match EdgeEnv summary", + ) + _record( + payload.get("policy_pressure_summary_errors") == [], + errors, + "AIGuard alignment policy_pressure_summary_errors must be empty", + ) _record( payload.get("guard_alignment_summary_errors") == [], errors, @@ -568,6 +588,10 @@ def _validate_aiguard_handoff_alignment( "[edgeenv-smoke-candidate, edgeenv-smoke-missing]", "guard_analysis_producer_lineage_guard_alignment_run_ids: " "[edgeenv-smoke-candidate, edgeenv-smoke-missing]", + "handoff_policy_pressure_summary_run_ids: " + "[edgeenv-smoke-candidate]", + "guard_analysis_policy_pressure_summary_run_ids: " + "[edgeenv-smoke-candidate]", ] if expected_optional_present_source_artifact is not None: expected_markers.append( diff --git a/tests/test_runtime_intelligence_ci_template.py b/tests/test_runtime_intelligence_ci_template.py index 20e8f8a..d6a68b9 100644 --- a/tests/test_runtime_intelligence_ci_template.py +++ b/tests/test_runtime_intelligence_ci_template.py @@ -313,6 +313,11 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' '"guard_analysis_producer_lineage_guard_alignment_run_ids":' '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' + '"handoff_policy_pressure_summary_run_ids":' + '["edgeenv-smoke-candidate"],' + '"guard_analysis_policy_pressure_summary_run_ids":' + '["edgeenv-smoke-candidate"],' + '"policy_pressure_summary_errors":[],' '"guard_alignment_summary_errors":[],"errors":[]}', encoding="utf-8", ) @@ -332,6 +337,8 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "- missing_optional_evidence_types: [edgeenv_orchestrator_stale_drop_summary, stale_frame_risk]", "- handoff_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing]", "- guard_analysis_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing]", + "- handoff_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate]", + "- guard_analysis_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate]", ] ), encoding="utf-8", @@ -395,6 +402,11 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' '"guard_analysis_producer_lineage_guard_alignment_run_ids":' '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' + '"handoff_policy_pressure_summary_run_ids":' + '["edgeenv-smoke-candidate"],' + '"guard_analysis_policy_pressure_summary_run_ids":' + '["edgeenv-smoke-candidate"],' + '"policy_pressure_summary_errors":[],' '"guard_alignment_summary_errors":[],"errors":[]}', encoding="utf-8", ) @@ -418,6 +430,8 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "- optional_present_reproduction_command: python -m inferedge_aiguard.cli build-runtime-intelligence-optional-stale-drop --edgeenv-regression examples/runtime_intelligence/edgeenv_runtime_regression_with_optional_stale_drop_context.json --remote-dispatch examples/runtime_intelligence/remote_dispatch_fallback_recovered_result.json --orchestration-summary examples/runtime_intelligence/orchestrator_multi_workload_sustained_summary.json --save-json examples/runtime_intelligence/aiguard_runtime_operation_guard_analysis_optional_stale_drop.json", "- handoff_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing]", "- guard_analysis_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing]", + "- handoff_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate]", + "- guard_analysis_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate]", ] ), encoding="utf-8", @@ -774,6 +788,11 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_lab_marker_cont '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' '"guard_analysis_producer_lineage_guard_alignment_run_ids":' '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' + '"handoff_policy_pressure_summary_run_ids":' + '["edgeenv-smoke-candidate"],' + '"guard_analysis_policy_pressure_summary_run_ids":' + '["edgeenv-smoke-candidate"],' + '"policy_pressure_summary_errors":[],' '"guard_alignment_summary_errors":[],"errors":[]}', encoding="utf-8", ) @@ -785,6 +804,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_lab_marker_cont "- diagnosis_owner: aiguard", "- handoff_producer_lineage_guard_alignment_run_ids: edgeenv-smoke-candidate, edgeenv-smoke-missing", "- guard_analysis_producer_lineage_guard_alignment_run_ids: edgeenv-smoke-candidate, edgeenv-smoke-missing", + "- handoff_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate]", + "- guard_analysis_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate]", ] ), encoding="utf-8", @@ -1179,6 +1200,11 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_failed_deployment_risk( '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' '"guard_analysis_producer_lineage_guard_alignment_run_ids":' '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' + '"handoff_policy_pressure_summary_run_ids":' + '["edgeenv-smoke-candidate"],' + '"guard_analysis_policy_pressure_summary_run_ids":' + '["edgeenv-smoke-candidate"],' + '"policy_pressure_summary_errors":[],' '"guard_alignment_summary_errors":[],"errors":[]}', encoding="utf-8", ) @@ -1193,6 +1219,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_failed_deployment_risk( "- aiguard_validates_expected_report_markers: False", "- handoff_producer_lineage_guard_alignment_run_ids: edgeenv-smoke-candidate, edgeenv-smoke-missing", "- guard_analysis_producer_lineage_guard_alignment_run_ids: edgeenv-smoke-candidate, edgeenv-smoke-missing", + "- handoff_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate]", + "- guard_analysis_policy_pressure_summary_run_ids: [edgeenv-smoke-candidate]", ] ), encoding="utf-8", diff --git a/tests/test_runtime_intelligence_smoke_script.py b/tests/test_runtime_intelligence_smoke_script.py index d5cd9e3..58dfd6f 100644 --- a/tests/test_runtime_intelligence_smoke_script.py +++ b/tests/test_runtime_intelligence_smoke_script.py @@ -165,6 +165,13 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): "edgeenv_orchestrator_stale_drop_summary", "stale_frame_risk", ] + assert alignment_payload["handoff_policy_pressure_summary_run_ids"] == [ + "edgeenv-smoke-candidate" + ] + assert alignment_payload[ + "guard_analysis_policy_pressure_summary_run_ids" + ] == ["edgeenv-smoke-candidate"] + assert alignment_payload["policy_pressure_summary_errors"] == [] assert "status: passed" in alignment_summary assert "decision_owner: lab" in alignment_summary assert "diagnosis_owner: aiguard" in alignment_summary @@ -195,6 +202,14 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): "guard_analysis_producer_lineage_guard_alignment_run_ids: " "[edgeenv-smoke-candidate, edgeenv-smoke-missing]" ) in alignment_summary + assert ( + "handoff_policy_pressure_summary_run_ids: " + "[edgeenv-smoke-candidate]" + ) in alignment_summary + assert ( + "guard_analysis_policy_pressure_summary_run_ids: " + "[edgeenv-smoke-candidate]" + ) in alignment_summary optional_present_summary = ( output_dir / "aiguard_edgeenv_handoff_alignment_optional_present.md" ).read_text(encoding="utf-8") @@ -219,6 +234,13 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): "stale_frame_risk", ] assert optional_present_payload["missing_optional_evidence_types"] == [] + assert optional_present_payload["handoff_policy_pressure_summary_run_ids"] == [ + "edgeenv-smoke-candidate" + ] + assert optional_present_payload[ + "guard_analysis_policy_pressure_summary_run_ids" + ] == ["edgeenv-smoke-candidate"] + assert optional_present_payload["policy_pressure_summary_errors"] == [] assert optional_present_payload["optional_present_source_artifact"] == { "repository": "InferEdgeAIGuard", "path": (