From 7f60b6c71e4a05007e9c96c464fc1e2d01b90801 Mon Sep 17 00:00:00 2001 From: hyeokjun32 Date: Thu, 18 Jun 2026 22:24:16 +0900 Subject: [PATCH] Surface policy pressure evidence in Lab reports --- .../runtime_intelligence_gitlab_artifacts.md | 4 +- .../edgeenv_runtime_regression_lab_handoff.md | 2 +- .../aiguard_edgeenv_handoff_alignment.json | 5 +- .../aiguard_edgeenv_handoff_alignment.md | 12 +-- ...nv_handoff_alignment_optional_present.json | 5 +- ...eenv_handoff_alignment_optional_present.md | 12 +-- ...uard_runtime_operation_guard_analysis.json | 82 +++++++++++++++++++ .../bundle_manifest.json | 13 +-- .../edgeenv_lab_handoff_manifest.json | 2 + inferedgelab/report/runtime_intelligence.py | 60 ++++++++++++++ ...ck_runtime_intelligence_artifact_bundle.py | 11 +++ ...ck_runtime_intelligence_bundle_manifest.py | 80 ++++++++++++++++++ ...check_runtime_intelligence_ci_artifacts.py | 4 + tests/test_report_generators.py | 53 ++++++++++++ .../test_runtime_intelligence_ci_template.py | 29 +++++-- 15 files changed, 346 insertions(+), 28 deletions(-) diff --git a/docs/ci/runtime_intelligence_gitlab_artifacts.md b/docs/ci/runtime_intelligence_gitlab_artifacts.md index 1e917f8..9095c25 100644 --- a/docs/ci/runtime_intelligence_gitlab_artifacts.md +++ b/docs/ci/runtime_intelligence_gitlab_artifacts.md @@ -167,6 +167,7 @@ to remain present in EdgeEnv/AIGuard handoff context. It also requires AIGuard `edgeenv_orchestrator_task_event_rollup`, `edgeenv_orchestrator_operation_timeline_summary`, `edgeenv_orchestrator_scheduler_fairness_summary`, +`edgeenv_orchestrator_policy_pressure_summary`, `runtime_history_seed_run_config_traceability`, and `remote_execution_recovered_by_fallback` evidence so the smoke remains a cross-repo handoff fixture rather than a Lab-only report sample. When an @@ -185,6 +186,7 @@ packaging runs. That marker set preserves `Runtime Intelligence Risk Summary`, `AIGuard operation risk rollup evidence`, `AIGuard operation timeline evidence`, `AIGuard scheduler fairness evidence`, +`AIGuard policy pressure evidence`, `AIGuard runtime operation anomalies`, `AIGuard remote dispatch event summary`, `AIGuard remote event summary consistency`, @@ -207,7 +209,7 @@ timeline summary run IDs against the preserved EdgeEnv regression context, so compact AIGuard operation evidence remains traceable to producer-side Orchestrator context. -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, 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. +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. The bundle manifest gate also checks the external AIGuard artifact before the rendered report stage. In particular, `runtime_queue_overload` must preserve diff --git a/docs/portfolio/edgeenv_runtime_regression_lab_handoff.md b/docs/portfolio/edgeenv_runtime_regression_lab_handoff.md index 868705d..131789f 100644 --- a/docs/portfolio/edgeenv_runtime_regression_lab_handoff.md +++ b/docs/portfolio/edgeenv_runtime_regression_lab_handoff.md @@ -192,7 +192,7 @@ Expected Lab behavior: - The same gate requires EdgeEnv-preserved Orchestrator producer markers to carry `source_repository=InferEdgeOrchestrator`, `artifact_role=orchestrator-supplemental-operation-context`, and `producer_contract=inferedge-orchestrator-edgeenv-runtime-telemetry-feed-v1`. - When EdgeEnv preservation context is present, Lab renders `Lab EdgeEnv preservation context` with `lab_report_preservation_context_present=True`, `lab_preservation=present`, and `lab_context=present` so the Runtime Intelligence report gate and entrypoint evidence index use the same Lab-owned marker vocabulary. - When an EdgeEnv handoff manifest is provided, the bundle gate requires EdgeEnv-produced file keys, external AIGuard file keys, source repository mapping, artifact roles, producer contracts, and boundary flags to match Lab's Runtime Intelligence bundle contract. -- The same manifest gate requires `expected_report_markers` to preserve these exact Lab-owned report markers: `Runtime Intelligence Risk Summary`, `Runtime replay duration scope`, `Orchestrator operation feed context`, `EdgeEnv fixture matrix coverage`, `Reviewer operation quick scan`, `Orchestrator task event rollup`, `Lab EdgeEnv preservation context`, `AIGuard operation risk rollup evidence`, `AIGuard task event rollup evidence`, `AIGuard operation timeline evidence`, `AIGuard scheduler fairness evidence`, `AIGuard runtime operation anomalies`, `AIGuard remote dispatch event summary`, `AIGuard remote event summary consistency`, `Remote fallback starter evidence`, `lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback`, `AIGuard producer-lineage guard alignment`, and `Lab remains the final deployment decision owner.`. +- The same manifest gate requires `expected_report_markers` to preserve these exact Lab-owned report markers: `Runtime Intelligence Risk Summary`, `Runtime replay duration scope`, `Orchestrator operation feed context`, `EdgeEnv fixture matrix coverage`, `Reviewer operation quick scan`, `Orchestrator task event rollup`, `Lab EdgeEnv preservation context`, `AIGuard operation risk rollup evidence`, `AIGuard task event rollup evidence`, `AIGuard operation timeline evidence`, `AIGuard scheduler fairness evidence`, `AIGuard policy pressure evidence`, `AIGuard runtime operation anomalies`, `AIGuard remote dispatch event summary`, `AIGuard remote event summary consistency`, `Remote fallback starter evidence`, `lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback`, `AIGuard producer-lineage guard alignment`, and `Lab remains the final deployment decision owner.`. - Reviewer navigation can trace Orchestrator curated samples through AIGuard evidence into Lab report rows: `agent_scheduler_delay_sample.json` -> `scheduler_delay_pattern` -> `Reviewer operation quick scan` / `Orchestrator queue/deadline/fallback markers`, and `remote_fallback_recovery_sample.json` -> `remote_execution_recovered_by_fallback` -> `Remote fallback starter evidence`. Lab does not treat those curated samples as benchmark outputs, production retry proof, or deployment policy inputs. - The external AIGuard artifact gate also requires `runtime_queue_overload` raw context to preserve diff --git a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json index ec4001b..db58a6b 100644 --- a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json @@ -9,7 +9,7 @@ "required_evidence_type_count": 10, "optional_evidence_type_count": 2, "guard_evidence_type_count": 11, - "lab_expected_report_marker_count": 18, + "lab_expected_report_marker_count": 19, "lab_expected_report_markers": [ "Runtime Intelligence Risk Summary", "Runtime replay duration scope", @@ -22,6 +22,7 @@ "AIGuard task event rollup evidence", "AIGuard operation timeline evidence", "AIGuard scheduler fairness evidence", + "AIGuard policy pressure evidence", "AIGuard runtime operation anomalies", "AIGuard remote dispatch event summary", "AIGuard remote event summary consistency", @@ -46,6 +47,7 @@ "edgeenv_orchestrator_task_event_rollup", "edgeenv_orchestrator_operation_timeline_summary", "edgeenv_orchestrator_scheduler_fairness_summary", + "edgeenv_orchestrator_policy_pressure_summary", "runtime_history_seed_run_config_traceability", "runtime_queue_overload", "runtime_thermal_instability", @@ -63,6 +65,7 @@ "edgeenv_orchestrator_task_event_rollup", "edgeenv_orchestrator_operation_timeline_summary", "edgeenv_orchestrator_scheduler_fairness_summary", + "edgeenv_orchestrator_policy_pressure_summary", "runtime_history_seed_run_config_traceability", "runtime_thermal_instability", "runtime_queue_overload", diff --git a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md index 15c5889..4316299 100644 --- a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md @@ -23,14 +23,14 @@ | Field | Values | | --- | --- | -| required_evidence_types | runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, runtime_history_seed_run_config_traceability, runtime_queue_overload, runtime_thermal_instability, remote_execution_recovered_by_fallback | +| required_evidence_types | runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, edgeenv_orchestrator_policy_pressure_summary, runtime_history_seed_run_config_traceability, runtime_queue_overload, runtime_thermal_instability, remote_execution_recovered_by_fallback | | optional_aiguard_evidence_types | stale_frame_risk, edgeenv_orchestrator_stale_drop_summary | -| guard_analysis_evidence_types | runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, runtime_history_seed_run_config_traceability, runtime_thermal_instability, runtime_queue_overload, remote_execution_recovered_by_fallback | +| guard_analysis_evidence_types | runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, edgeenv_orchestrator_policy_pressure_summary, runtime_history_seed_run_config_traceability, runtime_thermal_instability, runtime_queue_overload, remote_execution_recovered_by_fallback | | missing_required_evidence_types | [] | | optional_guard_evidence_types_present | [] | | missing_optional_evidence_types | edgeenv_orchestrator_stale_drop_summary, stale_frame_risk | | supplemental_guard_evidence_types | edgeenv_orchestrator_operation_risk_summary | -| lab_expected_report_markers | Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner. | +| lab_expected_report_markers | Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard policy pressure evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner. | | handoff_duration_sources | [] | | handoff_duration_scope_labels | [] | | errors | [] | @@ -43,16 +43,16 @@ InferEdgeAIGuard EdgeEnv handoff alignment summary - recommendation: alignment_satisfied - decision_owner: lab - diagnosis_owner: aiguard -- lab_expected_report_markers: [Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.] +- lab_expected_report_markers: [Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard policy pressure evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.] - report_marker_context_role: lab_report_contract_context - aiguard_validates_expected_report_markers: False - optional_evidence_context_role: read_only_optional_guard_context - aiguard_validates_optional_evidence_as_required: False - handoff_duration_sources: [] - handoff_duration_scope_labels: [] -- required_evidence_types: [runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, runtime_history_seed_run_config_traceability, runtime_queue_overload, runtime_thermal_instability, remote_execution_recovered_by_fallback] +- required_evidence_types: [runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, edgeenv_orchestrator_policy_pressure_summary, runtime_history_seed_run_config_traceability, runtime_queue_overload, runtime_thermal_instability, remote_execution_recovered_by_fallback] - optional_aiguard_evidence_types: [stale_frame_risk, edgeenv_orchestrator_stale_drop_summary] -- guard_analysis_evidence_types: [runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, runtime_history_seed_run_config_traceability, runtime_thermal_instability, runtime_queue_overload, remote_execution_recovered_by_fallback] +- guard_analysis_evidence_types: [runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, edgeenv_orchestrator_policy_pressure_summary, runtime_history_seed_run_config_traceability, runtime_thermal_instability, runtime_queue_overload, remote_execution_recovered_by_fallback] - missing_required_evidence_types: [] - optional_guard_evidence_types_present: [] - missing_optional_evidence_types: [edgeenv_orchestrator_stale_drop_summary, stale_frame_risk] 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 16e76ec..bbc6e6f 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 @@ -9,7 +9,7 @@ "required_evidence_type_count": 10, "optional_evidence_type_count": 2, "guard_evidence_type_count": 13, - "lab_expected_report_marker_count": 18, + "lab_expected_report_marker_count": 19, "lab_expected_report_markers": [ "Runtime Intelligence Risk Summary", "Runtime replay duration scope", @@ -22,6 +22,7 @@ "AIGuard task event rollup evidence", "AIGuard operation timeline evidence", "AIGuard scheduler fairness evidence", + "AIGuard policy pressure evidence", "AIGuard runtime operation anomalies", "AIGuard remote dispatch event summary", "AIGuard remote event summary consistency", @@ -46,6 +47,7 @@ "edgeenv_orchestrator_task_event_rollup", "edgeenv_orchestrator_operation_timeline_summary", "edgeenv_orchestrator_scheduler_fairness_summary", + "edgeenv_orchestrator_policy_pressure_summary", "runtime_history_seed_run_config_traceability", "runtime_queue_overload", "runtime_thermal_instability", @@ -63,6 +65,7 @@ "edgeenv_orchestrator_task_event_rollup", "edgeenv_orchestrator_operation_timeline_summary", "edgeenv_orchestrator_scheduler_fairness_summary", + "edgeenv_orchestrator_policy_pressure_summary", "runtime_history_seed_run_config_traceability", "runtime_thermal_instability", "runtime_queue_overload", 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 0b4a5e1..3128286 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 @@ -23,16 +23,16 @@ | Field | Values | | --- | --- | -| required_evidence_types | runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, runtime_history_seed_run_config_traceability, runtime_queue_overload, runtime_thermal_instability, remote_execution_recovered_by_fallback | +| required_evidence_types | runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, edgeenv_orchestrator_policy_pressure_summary, runtime_history_seed_run_config_traceability, runtime_queue_overload, runtime_thermal_instability, remote_execution_recovered_by_fallback | | optional_aiguard_evidence_types | stale_frame_risk, edgeenv_orchestrator_stale_drop_summary | -| guard_analysis_evidence_types | runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, runtime_history_seed_run_config_traceability, runtime_thermal_instability, runtime_queue_overload, remote_execution_recovered_by_fallback, stale_frame_risk, edgeenv_orchestrator_stale_drop_summary | +| guard_analysis_evidence_types | runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, edgeenv_orchestrator_policy_pressure_summary, runtime_history_seed_run_config_traceability, runtime_thermal_instability, runtime_queue_overload, remote_execution_recovered_by_fallback, stale_frame_risk, edgeenv_orchestrator_stale_drop_summary | | missing_required_evidence_types | [] | | optional_guard_evidence_types_present | edgeenv_orchestrator_stale_drop_summary, stale_frame_risk | | missing_optional_evidence_types | [] | | optional_present_source_artifact | InferEdgeAIGuard/examples/runtime_intelligence/aiguard_runtime_operation_guard_analysis_optional_stale_drop.json | | 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 | | supplemental_guard_evidence_types | edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_stale_drop_summary, stale_frame_risk | -| lab_expected_report_markers | Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner. | +| lab_expected_report_markers | Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard policy pressure evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner. | | handoff_duration_sources | [] | | handoff_duration_scope_labels | [] | | errors | [] | @@ -45,16 +45,16 @@ InferEdgeAIGuard EdgeEnv handoff alignment summary - recommendation: alignment_satisfied - decision_owner: lab - diagnosis_owner: aiguard -- lab_expected_report_markers: [Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.] +- lab_expected_report_markers: [Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard policy pressure evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.] - report_marker_context_role: lab_report_contract_context - aiguard_validates_expected_report_markers: False - optional_evidence_context_role: read_only_optional_guard_context - aiguard_validates_optional_evidence_as_required: False - handoff_duration_sources: [] - handoff_duration_scope_labels: [] -- required_evidence_types: [runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, runtime_history_seed_run_config_traceability, runtime_queue_overload, runtime_thermal_instability, remote_execution_recovered_by_fallback] +- required_evidence_types: [runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, edgeenv_orchestrator_policy_pressure_summary, runtime_history_seed_run_config_traceability, runtime_queue_overload, runtime_thermal_instability, remote_execution_recovered_by_fallback] - optional_aiguard_evidence_types: [stale_frame_risk, edgeenv_orchestrator_stale_drop_summary] -- guard_analysis_evidence_types: [runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, runtime_history_seed_run_config_traceability, runtime_thermal_instability, runtime_queue_overload, remote_execution_recovered_by_fallback, stale_frame_risk, edgeenv_orchestrator_stale_drop_summary] +- guard_analysis_evidence_types: [runtime_telemetry_context_coverage, edgeenv_orchestrator_producer_lineage, edgeenv_orchestrator_operation_risk_summary, edgeenv_orchestrator_operation_risk_rollup, edgeenv_orchestrator_task_event_rollup, edgeenv_orchestrator_operation_timeline_summary, edgeenv_orchestrator_scheduler_fairness_summary, edgeenv_orchestrator_policy_pressure_summary, runtime_history_seed_run_config_traceability, runtime_thermal_instability, runtime_queue_overload, remote_execution_recovered_by_fallback, stale_frame_risk, edgeenv_orchestrator_stale_drop_summary] - missing_required_evidence_types: [] - optional_guard_evidence_types_present: [edgeenv_orchestrator_stale_drop_summary, stale_frame_risk] - missing_optional_evidence_types: [] diff --git a/examples/runtime_intelligence_chain/aiguard_runtime_operation_guard_analysis.json b/examples/runtime_intelligence_chain/aiguard_runtime_operation_guard_analysis.json index 31e23e2..faba683 100644 --- a/examples/runtime_intelligence_chain/aiguard_runtime_operation_guard_analysis.json +++ b/examples/runtime_intelligence_chain/aiguard_runtime_operation_guard_analysis.json @@ -1639,6 +1639,88 @@ } } }, + { + "type": "edgeenv_orchestrator_policy_pressure_summary", + "metric_name": "orchestrator_policy_pressure_marker_count", + "observed_value": 5, + "baseline_value": 0, + "threshold": 1, + "delta": 5, + "delta_pct": null, + "increase_factor": null, + "severity": "medium", + "status": "warning", + "explanation": "EdgeEnv preserved Orchestrator policy_pressure summary with 5 review markers.", + "why_it_matters": "Policy-pressure context explains which tasks were limited, protected, or sent to fallback under queue backlog pressure.", + "suspected_causes": [ + "policy_decision_context", + "queue_pressure_context", + "fallback_policy_context", + "load_shedding_context", + "scheduler_delay_context" + ], + "recommendation": "Review policy_pressure in Lab alongside operation timeline, task event rollup, and scheduler fairness evidence.", + "raw_context": { + "policy_pressure_summary": { + "summary": { + "schema_version": "inferedge-orchestrator-policy-pressure-summary-v1", + "role": "supplemental", + "decision_owner": "lab", + "scheduler_owner": "orchestrator", + "not_a_deployment_decision": true, + "decision_count": 2, + "decision_reason_counts": { + "queue_backlog_threshold_exceeded": 2 + }, + "limited_tasks": [ + "vision_agent", + "voice_command_agent" + ], + "protected_tasks": [ + "safety_monitor_agent" + ], + "fallback_tasks": [ + "voice_command_agent" + ], + "fallback_decision_count": 1, + "backlog_thresholds": [ + 3 + ], + "max_total_backlog_before": 7, + "max_backlog_over_threshold": 4, + "pressure_markers": [ + "policy_decision_present", + "backlog_exceeded_threshold", + "fallback_policy_used", + "workload_limited_by_policy", + "scheduler_delay_present" + ], + "interpretation": "Scheduler policy pressure preserved as Lab review context only.", + "first_read": "review_policy_pressure_context" + }, + "marker_count": 5, + "decision_count": 2, + "decision_reason_counts": { + "queue_backlog_threshold_exceeded": 2 + }, + "limited_tasks": [ + "vision_agent", + "voice_command_agent" + ], + "protected_tasks": [ + "safety_monitor_agent" + ], + "fallback_tasks": [ + "voice_command_agent" + ], + "max_backlog_over_threshold": 4, + "decision_owner": "lab", + "scheduler_owner": "orchestrator", + "not_a_deployment_decision": true, + "boundary_markers_valid": true + } + } + }, { "type": "runtime_history_seed_run_config_traceability", "metric_name": "runtime_history_seed_run_config_runs", diff --git a/examples/runtime_intelligence_chain/bundle_manifest.json b/examples/runtime_intelligence_chain/bundle_manifest.json index 8b818ee..52f13c1 100644 --- a/examples/runtime_intelligence_chain/bundle_manifest.json +++ b/examples/runtime_intelligence_chain/bundle_manifest.json @@ -24,12 +24,12 @@ "aiguard_guard_analysis": "aiguard-deterministic-runtime-anomaly-evidence", "lab_report": "lab-owned-deployment-risk-report" }, - "producer_contracts": { - "runtime_result_contract": "lab-compatible-runtime-result-json", - "runtime_telemetry_history_seed_schema": "inferedge-runtime-telemetry-history-seed-v1", - "edgeenv_history_schema": "edgeenv.runtime-telemetry-history.v1", - "orchestrator_feed_schema": "inferedge-orchestrator-edgeenv-runtime-telemetry-feed-v1", - "aiguard_schema": "inferedge-aiguard-diagnosis-v1" + "producer_contracts": { + "runtime_result_contract": "lab-compatible-runtime-result-json", + "runtime_telemetry_history_seed_schema": "inferedge-runtime-telemetry-history-seed-v1", + "edgeenv_history_schema": "edgeenv.runtime-telemetry-history.v1", + "orchestrator_feed_schema": "inferedge-orchestrator-edgeenv-runtime-telemetry-feed-v1", + "aiguard_schema": "inferedge-aiguard-diagnosis-v1" }, "ownership": { "runtime_result_owner": "runtime", @@ -57,6 +57,7 @@ "AIGuard task event rollup evidence", "AIGuard operation timeline evidence", "AIGuard scheduler fairness evidence", + "AIGuard policy pressure evidence", "AIGuard runtime operation anomalies", "AIGuard remote dispatch event summary", "AIGuard remote event summary consistency", diff --git a/examples/runtime_intelligence_chain/edgeenv_lab_handoff_manifest.json b/examples/runtime_intelligence_chain/edgeenv_lab_handoff_manifest.json index e072300..df4679e 100644 --- a/examples/runtime_intelligence_chain/edgeenv_lab_handoff_manifest.json +++ b/examples/runtime_intelligence_chain/edgeenv_lab_handoff_manifest.json @@ -64,6 +64,7 @@ "edgeenv_orchestrator_task_event_rollup", "edgeenv_orchestrator_operation_timeline_summary", "edgeenv_orchestrator_scheduler_fairness_summary", + "edgeenv_orchestrator_policy_pressure_summary", "runtime_history_seed_run_config_traceability", "runtime_queue_overload", "runtime_thermal_instability", @@ -111,6 +112,7 @@ "AIGuard task event rollup evidence", "AIGuard operation timeline evidence", "AIGuard scheduler fairness evidence", + "AIGuard policy pressure evidence", "AIGuard runtime operation anomalies", "AIGuard remote dispatch event summary", "AIGuard remote event summary consistency", diff --git a/inferedgelab/report/runtime_intelligence.py b/inferedgelab/report/runtime_intelligence.py index efdb61f..11da9a9 100644 --- a/inferedgelab/report/runtime_intelligence.py +++ b/inferedgelab/report/runtime_intelligence.py @@ -34,6 +34,10 @@ "edgeenv_orchestrator_scheduler_fairness_summary" ) +ORCHESTRATOR_POLICY_PRESSURE_EVIDENCE_TYPE = ( + "edgeenv_orchestrator_policy_pressure_summary" +) + RUN_CONFIG_TRACEABILITY_EVIDENCE_TYPE = "runtime_history_seed_run_config_traceability" REMOTE_RUNTIME_EVENT_SUMMARY_MISMATCH_EVIDENCE_TYPE = ( @@ -1564,6 +1568,16 @@ def _append_aiguard_runtime_operation_rows( ) ) + policy_pressure_label = _aiguard_policy_pressure_label(evidence_items) + if policy_pressure_label: + rows.append( + ( + "AIGuard policy pressure evidence", + policy_pressure_label, + "AIGuard preserves scheduler policy-pressure context as deterministic review evidence; Lab still owns the deployment decision.", + ) + ) + candidate_summary = guard_analysis.get("candidate_summary") if not isinstance(candidate_summary, dict): return @@ -2036,6 +2050,52 @@ def _aiguard_scheduler_fairness_label( return ", ".join(parts) +def _aiguard_policy_pressure_label( + evidence_items: list[dict[str, Any]], +) -> str: + evidence = _find_evidence_item( + evidence_items, + ORCHESTRATOR_POLICY_PRESSURE_EVIDENCE_TYPE, + ) + if evidence is None: + return "" + + parts: list[str] = [] + status = evidence.get("status") + if status is not None: + parts.append(f"status={status}") + observed = evidence.get("observed_value") + if observed is not None: + parts.append(f"markers={_format_compact_value(observed)}") + + raw_context = evidence.get("raw_context") + if isinstance(raw_context, dict): + context = raw_context.get("policy_pressure_summary") + if isinstance(context, dict): + limited_tasks = _string_list(context.get("limited_tasks")) + if limited_tasks: + parts.append("limited=" + ",".join(limited_tasks)) + protected_tasks = _string_list(context.get("protected_tasks")) + if protected_tasks: + parts.append("protected=" + ",".join(protected_tasks)) + fallback_tasks = _string_list(context.get("fallback_tasks")) + if fallback_tasks: + parts.append("fallback=" + ",".join(fallback_tasks)) + reason_counts = context.get("decision_reason_counts") + if isinstance(reason_counts, dict) and reason_counts: + parts.append("reasons=" + _format_reason_count_label(reason_counts)) + max_over_threshold = context.get("max_backlog_over_threshold") + if max_over_threshold is not None: + parts.append( + "max_backlog_over_threshold=" + f"{_format_compact_value(max_over_threshold)}" + ) + boundary_valid = context.get("boundary_markers_valid") + if boundary_valid is not None: + parts.append(f"boundary_valid={boundary_valid}") + return ", ".join(parts) + + def _append_aiguard_remote_dispatch_rows( rows: list[tuple[str, str, str]], guard_analysis: dict[str, Any], diff --git a/scripts/check_runtime_intelligence_artifact_bundle.py b/scripts/check_runtime_intelligence_artifact_bundle.py index d211ee2..9bd96d8 100644 --- a/scripts/check_runtime_intelligence_artifact_bundle.py +++ b/scripts/check_runtime_intelligence_artifact_bundle.py @@ -156,6 +156,13 @@ "aiguard_scheduler_fairness_type": ( "edgeenv_orchestrator_scheduler_fairness_summary" ), + "aiguard_policy_pressure_evidence": ( + "| AIGuard policy pressure evidence | " + "status=warning, markers=5" + ), + "aiguard_policy_pressure_type": ( + "edgeenv_orchestrator_policy_pressure_summary" + ), "aiguard_remote_dispatch_summary": ( "| AIGuard remote dispatch event summary | " "events=3, final=succeeded, fallback_recovered=True |" @@ -285,6 +292,10 @@ "aiguard_scheduler_fairness_type": ( "edgeenv_orchestrator_scheduler_fairness_summary" ), + "aiguard_policy_pressure_evidence": "AIGuard policy pressure evidence", + "aiguard_policy_pressure_type": ( + "edgeenv_orchestrator_policy_pressure_summary" + ), "aiguard_remote_dispatch_summary": "AIGuard remote dispatch event summary", "aiguard_remote_dispatch_label": ( "events=3, final=succeeded, fallback_recovered=True" diff --git a/scripts/check_runtime_intelligence_bundle_manifest.py b/scripts/check_runtime_intelligence_bundle_manifest.py index bcf8481..d9cd228 100644 --- a/scripts/check_runtime_intelligence_bundle_manifest.py +++ b/scripts/check_runtime_intelligence_bundle_manifest.py @@ -101,6 +101,7 @@ "edgeenv_orchestrator_task_event_rollup", "edgeenv_orchestrator_operation_timeline_summary", "edgeenv_orchestrator_scheduler_fairness_summary", + "edgeenv_orchestrator_policy_pressure_summary", "runtime_history_seed_run_config_traceability", "runtime_queue_overload", "runtime_thermal_instability", @@ -177,6 +178,7 @@ "AIGuard task event rollup evidence", "AIGuard operation timeline evidence", "AIGuard scheduler fairness evidence", + "AIGuard policy pressure evidence", "AIGuard runtime operation anomalies", "AIGuard remote dispatch event summary", "AIGuard remote event summary consistency", @@ -205,11 +207,13 @@ "aiguard_evidence: edgeenv_orchestrator_task_event_rollup validated", "aiguard_evidence: edgeenv_orchestrator_operation_timeline_summary validated", "aiguard_evidence: edgeenv_orchestrator_scheduler_fairness_summary validated", + "aiguard_evidence: edgeenv_orchestrator_policy_pressure_summary validated", "aiguard_evidence: runtime_history_seed_run_config_traceability validated", "aiguard_evidence: remote_execution_recovered_by_fallback validated", "aiguard_raw_context: producer_lineage_shape preserved", "aiguard_raw_context: task_event_rollup preserved", "aiguard_raw_context: scheduler_fairness_summary preserved", + "aiguard_raw_context: policy_pressure_summary preserved", "aiguard_raw_context: history_seed_run_config_traceability preserved", "aiguard_raw_context: remote_runtime_event_summary preserved", "aiguard_raw_context: remote_runtime_summary_boundary preserved", @@ -1893,6 +1897,8 @@ def _validate_guard_analysis(guard_analysis: dict[str, Any], errors: list[str]) _validate_operation_timeline_evidence(item, index, errors) if item.get("type") == "edgeenv_orchestrator_scheduler_fairness_summary": _validate_scheduler_fairness_evidence(item, index, errors) + if item.get("type") == "edgeenv_orchestrator_policy_pressure_summary": + _validate_policy_pressure_evidence(item, index, errors) if item.get("type") == "runtime_history_seed_run_config_traceability": _validate_run_config_traceability_evidence(item, index, errors) if item.get("type") == "remote_execution_recovered_by_fallback": @@ -2491,6 +2497,80 @@ def _validate_scheduler_fairness_evidence( ) +def _validate_policy_pressure_evidence( + item: dict[str, Any], + index: int, + errors: list[str], +) -> None: + _record( + item.get("status") == "warning", + errors, + f"AIGuard evidence[{index}] policy pressure status must be warning", + ) + _record( + item.get("observed_value") == 5, + errors, + f"AIGuard evidence[{index}] policy pressure observed_value must be 5", + ) + raw_context = item.get("raw_context") or {} + pressure = raw_context.get("policy_pressure_summary") + _record( + isinstance(pressure, dict), + errors, + f"AIGuard evidence[{index}] raw_context.policy_pressure_summary must be an object", + ) + if not isinstance(pressure, dict): + return + + _record( + pressure.get("boundary_markers_valid") is True, + errors, + f"AIGuard evidence[{index}] policy_pressure_summary.boundary_markers_valid " + "must be true", + ) + _record( + pressure.get("limited_tasks") == ["vision_agent", "voice_command_agent"], + errors, + f"AIGuard evidence[{index}] policy_pressure_summary.limited_tasks " + "must preserve vision_agent and voice_command_agent", + ) + _record( + pressure.get("protected_tasks") == ["safety_monitor_agent"], + errors, + f"AIGuard evidence[{index}] policy_pressure_summary.protected_tasks " + "must preserve safety_monitor_agent", + ) + _record( + pressure.get("fallback_tasks") == ["voice_command_agent"], + errors, + f"AIGuard evidence[{index}] policy_pressure_summary.fallback_tasks " + "must preserve voice_command_agent", + ) + reason_counts = pressure.get("decision_reason_counts") + _record( + isinstance(reason_counts, dict) + and reason_counts.get("queue_backlog_threshold_exceeded") == 2, + errors, + f"AIGuard evidence[{index}] policy_pressure_summary.decision_reason_counts " + "must preserve queue_backlog_threshold_exceeded:2", + ) + _record( + pressure.get("decision_owner") == "lab", + errors, + f"AIGuard evidence[{index}] policy_pressure_summary.decision_owner must be lab", + ) + _record( + pressure.get("scheduler_owner") == "orchestrator", + errors, + f"AIGuard evidence[{index}] policy_pressure_summary.scheduler_owner must be orchestrator", + ) + _record( + pressure.get("not_a_deployment_decision") is True, + errors, + f"AIGuard evidence[{index}] policy_pressure_summary.not_a_deployment_decision must be true", + ) + + def _validate_run_config_traceability_evidence( item: dict[str, Any], index: int, diff --git a/scripts/check_runtime_intelligence_ci_artifacts.py b/scripts/check_runtime_intelligence_ci_artifacts.py index 655e15f..0becf02 100644 --- a/scripts/check_runtime_intelligence_ci_artifacts.py +++ b/scripts/check_runtime_intelligence_ci_artifacts.py @@ -47,11 +47,13 @@ "aiguard_evidence: edgeenv_orchestrator_task_event_rollup validated", "aiguard_evidence: edgeenv_orchestrator_operation_timeline_summary validated", "aiguard_evidence: edgeenv_orchestrator_scheduler_fairness_summary validated", + "aiguard_evidence: edgeenv_orchestrator_policy_pressure_summary validated", "aiguard_evidence: runtime_history_seed_run_config_traceability validated", "aiguard_evidence: remote_execution_recovered_by_fallback validated", "aiguard_raw_context: producer_lineage_shape preserved", "aiguard_raw_context: task_event_rollup preserved", "aiguard_raw_context: scheduler_fairness_summary preserved", + "aiguard_raw_context: policy_pressure_summary preserved", "aiguard_raw_context: history_seed_run_config_traceability preserved", "aiguard_raw_context: remote_runtime_event_summary preserved", "aiguard_raw_context: remote_runtime_summary_boundary preserved", @@ -92,6 +94,7 @@ "AIGuard task event rollup evidence", "AIGuard operation timeline evidence", "AIGuard scheduler fairness evidence", + "AIGuard policy pressure evidence", "AIGuard runtime operation anomalies", "AIGuard remote dispatch event summary", "AIGuard remote event summary consistency", @@ -545,6 +548,7 @@ def _validate_aiguard_handoff_alignment( "AIGuard task event rollup evidence, " "AIGuard operation timeline evidence, " "AIGuard scheduler fairness evidence, " + "AIGuard policy pressure evidence, " "AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, " "AIGuard remote event summary consistency, " "Remote fallback starter evidence, " diff --git a/tests/test_report_generators.py b/tests/test_report_generators.py index 6f69699..9e58e32 100644 --- a/tests/test_report_generators.py +++ b/tests/test_report_generators.py @@ -642,6 +642,48 @@ def make_runtime_operation_guard_analysis() -> dict: } }, }, + { + "type": "edgeenv_orchestrator_policy_pressure_summary", + "metric_name": "orchestrator_policy_pressure_marker_count", + "observed_value": 5, + "baseline_value": 0, + "threshold": 1, + "status": "warning", + "severity": "medium", + "why_it_matters": ( + "Policy-pressure context explains which tasks were limited, " + "protected, or sent to fallback under queue backlog pressure." + ), + "suspected_causes": [ + "policy_decision_context", + "queue_pressure_context", + "fallback_policy_context", + "load_shedding_context", + "scheduler_delay_context", + ], + "recommendation": ( + "Review policy_pressure in Lab alongside operation timeline, " + "task event rollup, and scheduler fairness evidence." + ), + "raw_context": { + "policy_pressure_summary": { + "boundary_markers_valid": True, + "limited_tasks": [ + "vision_agent", + "voice_command_agent", + ], + "protected_tasks": ["safety_monitor_agent"], + "fallback_tasks": ["voice_command_agent"], + "decision_reason_counts": { + "queue_backlog_threshold_exceeded": 2, + }, + "max_backlog_over_threshold": 4, + "decision_owner": "lab", + "scheduler_owner": "orchestrator", + "not_a_deployment_decision": True, + } + }, + }, ], "candidate_summary": { "edgeenv_regression": { @@ -1095,6 +1137,13 @@ def test_generate_compare_markdown_summarizes_orchestrator_context_risk(): "max_latency_ms=72, policy_decisions=2, " "policy=queue_backlog_threshold_exceeded, boundary_valid=True |" ) in text + assert ( + "| AIGuard policy pressure evidence | " + "status=warning, markers=5, limited=vision_agent,voice_command_agent, " + "protected=safety_monitor_agent, fallback=voice_command_agent, " + "reasons=queue_backlog_threshold_exceeded:2, " + "max_backlog_over_threshold=4, boundary_valid=True |" + ) in text assert "AIGuard does not own the final decision" in text @@ -1156,6 +1205,10 @@ def test_generate_compare_html_summarizes_operation_risk_summary(): assert "queue=queue_backlog_threshold_exceeded" in html assert "AIGuard operation risk rollup evidence" in html assert "risk=review" in html + assert "AIGuard policy pressure evidence" in html + assert "limited=vision_agent,voice_command_agent" in html + assert "protected=safety_monitor_agent" in html + assert "max_backlog_over_threshold=4" in html assert "Lab still owns the deployment decision" in html diff --git a/tests/test_runtime_intelligence_ci_template.py b/tests/test_runtime_intelligence_ci_template.py index fd69523..20e8f8a 100644 --- a/tests/test_runtime_intelligence_ci_template.py +++ b/tests/test_runtime_intelligence_ci_template.py @@ -170,6 +170,8 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "edgeenv_orchestrator_operation_timeline_summary", "AIGuard scheduler fairness evidence", "edgeenv_orchestrator_scheduler_fairness_summary", + "AIGuard policy pressure evidence", + "edgeenv_orchestrator_policy_pressure_summary", "Lab EdgeEnv preservation context", "lab_report_preservation_context_present=True", "lab_preservation=present", @@ -224,11 +226,13 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "- aiguard_evidence: edgeenv_orchestrator_task_event_rollup validated", "- aiguard_evidence: edgeenv_orchestrator_operation_timeline_summary validated", "- aiguard_evidence: edgeenv_orchestrator_scheduler_fairness_summary validated", + "- aiguard_evidence: edgeenv_orchestrator_policy_pressure_summary validated", "- aiguard_evidence: runtime_history_seed_run_config_traceability validated", "- aiguard_evidence: remote_execution_recovered_by_fallback validated", "- aiguard_raw_context: producer_lineage_shape preserved", "- aiguard_raw_context: task_event_rollup preserved", "- aiguard_raw_context: scheduler_fairness_summary preserved", + "- aiguard_raw_context: policy_pressure_summary preserved", "- aiguard_raw_context: history_seed_run_config_traceability preserved", "- aiguard_raw_context: remote_runtime_event_summary preserved", "- aiguard_raw_context: remote_runtime_summary_boundary preserved", @@ -272,7 +276,7 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p (report_dir / "aiguard_edgeenv_handoff_alignment.json").write_text( '{"schema_version":"inferedge-aiguard-edgeenv-handoff-alignment-v1",' '"status":"passed","decision_owner":"lab","diagnosis_owner":"aiguard",' - '"lab_expected_report_marker_count":18,' + '"lab_expected_report_marker_count":19,' '"lab_expected_report_markers":[' '"Runtime Intelligence Risk Summary",' '"Runtime replay duration scope",' @@ -285,6 +289,7 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p '"AIGuard task event rollup evidence",' '"AIGuard operation timeline evidence",' '"AIGuard scheduler fairness evidence",' + '"AIGuard policy pressure evidence",' '"AIGuard runtime operation anomalies",' '"AIGuard remote dispatch event summary",' '"AIGuard remote event summary consistency",' @@ -317,7 +322,7 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "- status: passed", "- decision_owner: lab", "- diagnosis_owner: aiguard", - "- lab_expected_report_markers: [Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.]", + "- lab_expected_report_markers: [Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard policy pressure evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.]", "- report_marker_context_role: lab_report_contract_context", "- aiguard_validates_expected_report_markers: False", "- optional_evidence_context_role: read_only_optional_guard_context", @@ -336,7 +341,7 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p ).write_text( '{"schema_version":"inferedge-aiguard-edgeenv-handoff-alignment-v1",' '"status":"passed","decision_owner":"lab","diagnosis_owner":"aiguard",' - '"lab_expected_report_marker_count":18,' + '"lab_expected_report_marker_count":19,' '"lab_expected_report_markers":[' '"Runtime Intelligence Risk Summary",' '"Runtime replay duration scope",' @@ -349,6 +354,7 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p '"AIGuard task event rollup evidence",' '"AIGuard operation timeline evidence",' '"AIGuard scheduler fairness evidence",' + '"AIGuard policy pressure evidence",' '"AIGuard runtime operation anomalies",' '"AIGuard remote dispatch event summary",' '"AIGuard remote event summary consistency",' @@ -400,7 +406,7 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "- status: passed", "- decision_owner: lab", "- diagnosis_owner: aiguard", - "- lab_expected_report_markers: [Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.]", + "- lab_expected_report_markers: [Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard policy pressure evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.]", "- report_marker_context_role: lab_report_contract_context", "- aiguard_validates_expected_report_markers: False", "- optional_evidence_context_role: read_only_optional_guard_context", @@ -664,6 +670,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_lab_marker_cont "edgeenv_orchestrator_operation_timeline_summary", "AIGuard scheduler fairness evidence", "edgeenv_orchestrator_scheduler_fairness_summary", + "AIGuard policy pressure evidence", + "edgeenv_orchestrator_policy_pressure_summary", "Lab EdgeEnv preservation context", "lab_report_preservation_context_present=True", "lab_preservation=present", @@ -718,6 +726,7 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_lab_marker_cont "- aiguard_evidence: edgeenv_orchestrator_task_event_rollup validated", "- aiguard_evidence: edgeenv_orchestrator_operation_timeline_summary validated", "- aiguard_evidence: edgeenv_orchestrator_scheduler_fairness_summary validated", + "- aiguard_evidence: edgeenv_orchestrator_policy_pressure_summary validated", "- aiguard_evidence: runtime_history_seed_run_config_traceability validated", "- aiguard_evidence: remote_execution_recovered_by_fallback validated", "- aiguard_raw_context: producer_lineage_shape preserved", @@ -841,6 +850,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_contract_marker "edgeenv_orchestrator_operation_timeline_summary", "AIGuard scheduler fairness evidence", "edgeenv_orchestrator_scheduler_fairness_summary", + "AIGuard policy pressure evidence", + "edgeenv_orchestrator_policy_pressure_summary", "Lab EdgeEnv preservation context", "lab_report_preservation_context_present=True", "lab_preservation=present", @@ -947,6 +958,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_coverage_gap_ma "edgeenv_orchestrator_operation_timeline_summary", "AIGuard scheduler fairness evidence", "edgeenv_orchestrator_scheduler_fairness_summary", + "AIGuard policy pressure evidence", + "edgeenv_orchestrator_policy_pressure_summary", "Lab EdgeEnv preservation context", "lab_report_preservation_context_present=True", "lab_preservation=present", @@ -1038,6 +1051,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_failed_deployment_risk( "edgeenv_orchestrator_operation_timeline_summary", "AIGuard scheduler fairness evidence", "edgeenv_orchestrator_scheduler_fairness_summary", + "AIGuard policy pressure evidence", + "edgeenv_orchestrator_policy_pressure_summary", "Lab EdgeEnv preservation context", "lab_report_preservation_context_present=True", "lab_preservation=present", @@ -1092,6 +1107,7 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_failed_deployment_risk( "- aiguard_evidence: edgeenv_orchestrator_task_event_rollup validated", "- aiguard_evidence: edgeenv_orchestrator_operation_timeline_summary validated", "- aiguard_evidence: edgeenv_orchestrator_scheduler_fairness_summary validated", + "- aiguard_evidence: edgeenv_orchestrator_policy_pressure_summary validated", "- aiguard_evidence: runtime_history_seed_run_config_traceability validated", "- aiguard_evidence: remote_execution_recovered_by_fallback validated", "- aiguard_raw_context: producer_lineage_shape preserved", @@ -1135,7 +1151,7 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_failed_deployment_risk( (report_dir / "aiguard_edgeenv_handoff_alignment.json").write_text( '{"schema_version":"inferedge-aiguard-edgeenv-handoff-alignment-v1",' '"status":"passed","decision_owner":"lab","diagnosis_owner":"aiguard",' - '"lab_expected_report_marker_count":18,' + '"lab_expected_report_marker_count":19,' '"lab_expected_report_markers":[' '"Runtime Intelligence Risk Summary",' '"Runtime replay duration scope",' @@ -1148,6 +1164,7 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_failed_deployment_risk( '"AIGuard task event rollup evidence",' '"AIGuard operation timeline evidence",' '"AIGuard scheduler fairness evidence",' + '"AIGuard policy pressure evidence",' '"AIGuard runtime operation anomalies",' '"AIGuard remote dispatch event summary",' '"AIGuard remote event summary consistency",' @@ -1171,7 +1188,7 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_failed_deployment_risk( "- status: passed", "- decision_owner: lab", "- diagnosis_owner: aiguard", - "- lab_expected_report_markers: Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.", + "- lab_expected_report_markers: Runtime Intelligence Risk Summary, Runtime replay duration scope, Orchestrator operation feed context, EdgeEnv fixture matrix coverage, Reviewer operation quick scan, Orchestrator task event rollup, Lab EdgeEnv preservation context, AIGuard operation risk rollup evidence, AIGuard task event rollup evidence, AIGuard operation timeline evidence, AIGuard scheduler fairness evidence, AIGuard policy pressure evidence, AIGuard runtime operation anomalies, AIGuard remote dispatch event summary, AIGuard remote event summary consistency, Remote fallback starter evidence, lab=Remote fallback starter evidence; evidence=remote_execution_recovered_by_fallback, AIGuard producer-lineage guard alignment, Lab remains the final deployment decision owner.", "- report_marker_context_role: lab_report_contract_context", "- aiguard_validates_expected_report_markers: False", "- handoff_producer_lineage_guard_alignment_run_ids: edgeenv-smoke-candidate, edgeenv-smoke-missing",