From 1f2f02bc5d12a6dab747ba0ff741099e8c6facf4 Mon Sep 17 00:00:00 2001 From: hyeokjun32 Date: Fri, 12 Jun 2026 00:36:30 +0900 Subject: [PATCH] Validate optional AIGuard alignment context --- README.md | 2 +- .../runtime_intelligence_gitlab_artifacts.md | 6 ++ .../aiguard_edgeenv_handoff_alignment.json | 17 ++++ .../aiguard_edgeenv_handoff_alignment.md | 65 +++++++++++++--- ...check_runtime_intelligence_ci_artifacts.py | 77 ++++++++++++++++++- .../test_runtime_intelligence_ci_template.py | 33 +++++++- .../test_runtime_intelligence_smoke_script.py | 59 +++++++++++++- 7 files changed, 239 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 365632a..c475481 100644 --- a/README.md +++ b/README.md @@ -581,7 +581,7 @@ bash scripts/smoke_runtime_intelligence_chain.sh \ --output-dir reports/runtime_intelligence_chain ``` -The smoke gates the EdgeEnv handoff history fixture for preserved device-local Orchestrator `candidate_context.producer` lineage and checks that EdgeEnv-declared external AIGuard evidence requirements are satisfied by the bundled `guard_analysis`. It also carries a precomputed AIGuard handoff-alignment artifact so the EdgeEnv handoff summary and AIGuard producer-lineage raw context agree on the same `producer_lineage_guard_alignment_run_ids`. This is an artifact integrity check only; EdgeEnv still owns comparability/regression evidence, AIGuard remains an optional deterministic evidence provider, and Lab still owns the deployment decision. +The smoke gates the EdgeEnv handoff history fixture for preserved device-local Orchestrator `candidate_context.producer` lineage and checks that EdgeEnv-declared external AIGuard evidence requirements are satisfied by the bundled `guard_analysis`. It also carries a precomputed AIGuard handoff-alignment artifact so the EdgeEnv handoff summary and AIGuard producer-lineage raw context agree on the same `producer_lineage_guard_alignment_run_ids`. When the handoff declares `optional_aiguard_evidence_types`, the copied AIGuard alignment artifact preserves them as `read_only_optional_guard_context` and keeps missing optional evidence out of the required-evidence failure path. This is an artifact integrity check only; EdgeEnv still owns comparability/regression evidence, AIGuard remains an optional deterministic evidence provider, and Lab still owns the deployment decision. The committed handoff smoke is documented in [docs/portfolio/edgeenv_runtime_regression_lab_handoff.md](docs/portfolio/edgeenv_runtime_regression_lab_handoff.md) diff --git a/docs/ci/runtime_intelligence_gitlab_artifacts.md b/docs/ci/runtime_intelligence_gitlab_artifacts.md index b0c3327..1928132 100644 --- a/docs/ci/runtime_intelligence_gitlab_artifacts.md +++ b/docs/ci/runtime_intelligence_gitlab_artifacts.md @@ -255,6 +255,12 @@ and the `Reviewer operation quick scan` row marker, `aiguard_validates_expected_report_markers` must remain `false`. This keeps AIGuard as a deterministic external evidence provider while leaving report marker enforcement to Lab's bundle/report gates. +The same alignment artifact also preserves +`optional_aiguard_evidence_types` as `read_only_optional_guard_context`. The CI +artifact gate checks `aiguard_validates_optional_evidence_as_required=false`, +records which optional stale-drop evidence labels are absent from the bundled +guard artifact, and keeps those absences out of the required evidence failure +path. Remote dispatch rows in this artifact chain are starter evidence only. The gates require worker-selection, fallback recovery, event-count, consistency, diff --git a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json index 07cfa41..4612749 100644 --- a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json @@ -7,6 +7,7 @@ "handoff_schema_version": "edgeenv.runtime-intelligence-lab-handoff.v1", "guard_analysis_schema_version": "inferedge-aiguard-diagnosis-v1", "required_evidence_type_count": 9, + "optional_evidence_type_count": 2, "guard_evidence_type_count": 10, "lab_expected_report_marker_count": 17, "lab_expected_report_markers": [ @@ -31,6 +32,12 @@ "lab_report_marker_owner": "lab", "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_traceability_present": false, + "handoff_duration_traceability_run_ids": [], + "handoff_duration_sources": [], + "handoff_duration_scope_labels": [], "required_evidence_types": [ "runtime_telemetry_context_coverage", "edgeenv_orchestrator_producer_lineage", @@ -42,6 +49,10 @@ "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", @@ -55,10 +66,16 @@ "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" ], "invalid_required_evidence_types": [], + "invalid_optional_evidence_types": [], "invalid_guard_evidence_items": [], "boundary_flags": { "aiguard_guard_analysis_is_external": true, diff --git a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md index 24aa1a8..3b036c2 100644 --- a/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md @@ -1,17 +1,62 @@ -# InferEdgeAIGuard EdgeEnv Handoff Alignment +# InferEdgeAIGuard EdgeEnv Handoff Alignment Report +## Summary + +| Metric | Value | +| --- | --- | +| status | passed | +| recommendation | alignment_satisfied | +| decision_owner | lab | +| diagnosis_owner | aiguard | +| required_evidence_type_count | 9 | +| optional_evidence_type_count | 2 | +| guard_evidence_type_count | 10 | +| lab_expected_report_marker_count | 17 | +| lab_report_marker_owner | lab | +| 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_traceability_present | False | + +## Evidence Alignment + +| 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, 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, 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 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 | [] | + +## Raw CLI Summary + +```text +InferEdgeAIGuard EdgeEnv handoff alignment summary - status: passed - 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 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 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 -- 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, runtime_history_seed_run_config_traceability, runtime_queue_overload, runtime_thermal_instability, 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, runtime_history_seed_run_config_traceability, runtime_thermal_instability, runtime_queue_overload, remote_execution_recovered_by_fallback -- missing_required_evidence_types: - -- 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 -- guard_alignment_summary_errors: - -- errors: - +- 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, 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, 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] +- 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] +``` diff --git a/scripts/check_runtime_intelligence_ci_artifacts.py b/scripts/check_runtime_intelligence_ci_artifacts.py index 88ef8a4..c7afc1a 100644 --- a/scripts/check_runtime_intelligence_ci_artifacts.py +++ b/scripts/check_runtime_intelligence_ci_artifacts.py @@ -97,6 +97,21 @@ "edgeenv-smoke-candidate", "edgeenv-smoke-missing", ] +REQUIRED_AIGUARD_OPTIONAL_EVIDENCE_TYPES = [ + "stale_frame_risk", + "edgeenv_orchestrator_stale_drop_summary", +] +REQUIRED_AIGUARD_MISSING_OPTIONAL_EVIDENCE_TYPES = [ + "edgeenv_orchestrator_stale_drop_summary", + "stale_frame_risk", +] +REQUIRED_AIGUARD_OPTIONAL_CONTEXT_SUMMARY_MARKERS = ( + "## Validated AIGuard Optional Handoff Context", + "aiguard_optional_context: read_only_optional_guard_context preserved", + "aiguard_optional_requirement_boundary: optional evidence not validated as required", + "aiguard_optional_types: stale_frame_risk, edgeenv_orchestrator_stale_drop_summary", + "aiguard_missing_optional_types: edgeenv_orchestrator_stale_drop_summary, stale_frame_risk", +) REQUIRED_DURATION_TRACEABILITY_SUMMARY_MARKERS = ( "## Validated Duration Traceability", "duration_handoff_alignment: EdgeEnv/AIGuard report context preserved", @@ -321,6 +336,45 @@ def _validate_aiguard_handoff_alignment( errors, "aiguard_edgeenv_handoff_alignment.json must not claim AIGuard validates Lab report markers", ) + _record( + payload.get("optional_evidence_context_role") + == "read_only_optional_guard_context", + errors, + "aiguard_edgeenv_handoff_alignment.json optional_evidence_context_role must be read_only_optional_guard_context", + ) + _record( + payload.get("aiguard_validates_optional_evidence_as_required") is False, + errors, + "aiguard_edgeenv_handoff_alignment.json must not validate optional evidence as required", + ) + _record( + payload.get("optional_evidence_type_count") + == len(REQUIRED_AIGUARD_OPTIONAL_EVIDENCE_TYPES), + errors, + "aiguard_edgeenv_handoff_alignment.json optional_evidence_type_count is invalid", + ) + _record( + payload.get("optional_aiguard_evidence_types") + == REQUIRED_AIGUARD_OPTIONAL_EVIDENCE_TYPES, + errors, + "aiguard_edgeenv_handoff_alignment.json optional evidence types must match EdgeEnv handoff context", + ) + _record( + payload.get("optional_guard_evidence_types_present") == [], + errors, + "aiguard_edgeenv_handoff_alignment.json optional evidence present list must reflect the bundled guard artifact", + ) + _record( + payload.get("missing_optional_evidence_types") + == REQUIRED_AIGUARD_MISSING_OPTIONAL_EVIDENCE_TYPES, + errors, + "aiguard_edgeenv_handoff_alignment.json missing optional evidence types must remain read-only context", + ) + _record( + payload.get("invalid_optional_evidence_types") == [], + errors, + "aiguard_edgeenv_handoff_alignment.json invalid_optional_evidence_types must be empty", + ) _record( payload.get("lab_expected_report_marker_count") == len(REQUIRED_LAB_EXPECTED_REPORT_MARKERS), @@ -366,7 +420,7 @@ def _validate_aiguard_handoff_alignment( "status: passed", "decision_owner: lab", "diagnosis_owner: aiguard", - "lab_expected_report_markers: " + "lab_expected_report_markers: [" "Runtime Intelligence Risk Summary, Runtime replay duration scope, " "Orchestrator operation feed context, " "EdgeEnv fixture matrix coverage, " @@ -382,13 +436,20 @@ def _validate_aiguard_handoff_alignment( "lab=Remote fallback starter evidence; " "evidence=remote_execution_recovered_by_fallback, " "AIGuard producer-lineage guard alignment, " - "Lab remains the final deployment decision owner.", + "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", + "optional_aiguard_evidence_types: " + "[stale_frame_risk, edgeenv_orchestrator_stale_drop_summary]", + "optional_guard_evidence_types_present: []", + "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", + "[edgeenv-smoke-candidate, edgeenv-smoke-missing]", "guard_analysis_producer_lineage_guard_alignment_run_ids: " - "edgeenv-smoke-candidate, edgeenv-smoke-missing", + "[edgeenv-smoke-candidate, edgeenv-smoke-missing]", ): _record( marker in text, @@ -436,6 +497,14 @@ def _write_summary(path: Path, report_dir: Path, errors: list[str]) -> None: if not marker.startswith("## ") ) lines.append("") + lines.append("## Validated AIGuard Optional Handoff Context") + lines.append("") + lines.extend( + f"- {marker}" + for marker in REQUIRED_AIGUARD_OPTIONAL_CONTEXT_SUMMARY_MARKERS + if not marker.startswith("## ") + ) + lines.append("") path.parent.mkdir(parents=True, exist_ok=True) path.write_text("\n".join(lines), encoding="utf-8") diff --git a/tests/test_runtime_intelligence_ci_template.py b/tests/test_runtime_intelligence_ci_template.py index 1ae1ed2..d339903 100644 --- a/tests/test_runtime_intelligence_ci_template.py +++ b/tests/test_runtime_intelligence_ci_template.py @@ -266,6 +266,15 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p '"lab_report_marker_owner":"lab",' '"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,' + '"optional_evidence_type_count":2,' + '"optional_aiguard_evidence_types":' + '["stale_frame_risk","edgeenv_orchestrator_stale_drop_summary"],' + '"optional_guard_evidence_types_present":[],' + '"missing_optional_evidence_types":' + '["edgeenv_orchestrator_stale_drop_summary","stale_frame_risk"],' + '"invalid_optional_evidence_types":[],' '"handoff_producer_lineage_guard_alignment_run_ids":' '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' '"guard_analysis_producer_lineage_guard_alignment_run_ids":' @@ -279,11 +288,16 @@ 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 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 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", - "- guard_analysis_producer_lineage_guard_alignment_run_ids: edgeenv-smoke-candidate, edgeenv-smoke-missing", + "- optional_evidence_context_role: read_only_optional_guard_context", + "- aiguard_validates_optional_evidence_as_required: False", + "- optional_aiguard_evidence_types: [stale_frame_risk, edgeenv_orchestrator_stale_drop_summary]", + "- optional_guard_evidence_types_present: []", + "- 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]", ] ), encoding="utf-8", @@ -345,6 +359,19 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "review_path_artifact_gate_summary: artifact gate summary reference row validated" in summary ) + assert "## Validated AIGuard Optional Handoff Context" in summary + assert ( + "aiguard_optional_context: read_only_optional_guard_context preserved" + in summary + ) + assert ( + "aiguard_optional_requirement_boundary: optional evidence not validated as required" + in summary + ) + assert ( + "aiguard_missing_optional_types: edgeenv_orchestrator_stale_drop_summary, stale_frame_risk" + in summary + ) (report_dir / "runtime_anomaly_gate_summary.md").write_text( "- Status: passed\n", diff --git a/tests/test_runtime_intelligence_smoke_script.py b/tests/test_runtime_intelligence_smoke_script.py index c76a1e6..1637d51 100644 --- a/tests/test_runtime_intelligence_smoke_script.py +++ b/tests/test_runtime_intelligence_smoke_script.py @@ -1,3 +1,4 @@ +import json import subprocess from pathlib import Path @@ -137,22 +138,76 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): alignment_summary = ( output_dir / "aiguard_edgeenv_handoff_alignment.md" ).read_text(encoding="utf-8") + alignment_payload = json.loads( + (output_dir / "aiguard_edgeenv_handoff_alignment.json").read_text( + encoding="utf-8" + ) + ) + assert alignment_payload["optional_evidence_context_role"] == ( + "read_only_optional_guard_context" + ) + assert alignment_payload["aiguard_validates_optional_evidence_as_required"] is False + assert alignment_payload["optional_aiguard_evidence_types"] == [ + "stale_frame_risk", + "edgeenv_orchestrator_stale_drop_summary", + ] + assert alignment_payload["optional_guard_evidence_types_present"] == [] + assert alignment_payload["missing_optional_evidence_types"] == [ + "edgeenv_orchestrator_stale_drop_summary", + "stale_frame_risk", + ] assert "status: passed" in alignment_summary assert "decision_owner: lab" in alignment_summary assert "diagnosis_owner: aiguard" in alignment_summary + assert ( + "optional_evidence_context_role: read_only_optional_guard_context" + in alignment_summary + ) + assert ( + "aiguard_validates_optional_evidence_as_required: False" + in alignment_summary + ) + assert ( + "optional_aiguard_evidence_types: " + "[stale_frame_risk, edgeenv_orchestrator_stale_drop_summary]" + in alignment_summary + ) + assert "optional_guard_evidence_types_present: []" in alignment_summary + assert ( + "missing_optional_evidence_types: " + "[edgeenv_orchestrator_stale_drop_summary, stale_frame_risk]" + in alignment_summary + ) assert ( "handoff_producer_lineage_guard_alignment_run_ids: " - "edgeenv-smoke-candidate, edgeenv-smoke-missing" + "[edgeenv-smoke-candidate, edgeenv-smoke-missing]" ) in alignment_summary assert ( "guard_analysis_producer_lineage_guard_alignment_run_ids: " - "edgeenv-smoke-candidate, edgeenv-smoke-missing" + "[edgeenv-smoke-candidate, edgeenv-smoke-missing]" ) in alignment_summary ci_summary = ( output_dir / "runtime_intelligence_ci_artifact_gate_summary.md" ).read_text(encoding="utf-8") assert "- Status: passed" in ci_summary + assert "## Validated AIGuard Optional Handoff Context" in ci_summary + assert ( + "aiguard_optional_context: read_only_optional_guard_context preserved" + in ci_summary + ) + assert ( + "aiguard_optional_requirement_boundary: optional evidence not validated as required" + in ci_summary + ) + assert ( + "aiguard_optional_types: stale_frame_risk, edgeenv_orchestrator_stale_drop_summary" + in ci_summary + ) + assert ( + "aiguard_missing_optional_types: edgeenv_orchestrator_stale_drop_summary, stale_frame_risk" + in ci_summary + ) assert "## Validated Duration Traceability" in ci_summary assert ( "duration_handoff_alignment: EdgeEnv/AIGuard report context preserved"