From 4db77c48ef3cfb7a6fbac3358147f7bc227b54af Mon Sep 17 00:00:00 2001 From: hyeokjun32 Date: Fri, 12 Jun 2026 00:46:02 +0900 Subject: [PATCH] Add optional-present AIGuard alignment fixture --- README.md | 2 +- .../runtime_intelligence_gitlab_artifacts.md | 6 +- ...nv_handoff_alignment_optional_present.json | 102 ++++++++++++++++++ ...eenv_handoff_alignment_optional_present.md | 62 +++++++++++ ...check_runtime_intelligence_ci_artifacts.py | 50 ++++++++- scripts/smoke_runtime_intelligence_chain.sh | 4 + .../test_runtime_intelligence_ci_template.py | 70 ++++++++++++ .../test_runtime_intelligence_smoke_script.py | 37 +++++++ 8 files changed, 326 insertions(+), 7 deletions(-) create mode 100644 examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.json create mode 100644 examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.md diff --git a/README.md b/README.md index c475481..569d87a 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`. 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 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 artifacts preserve them as `read_only_optional_guard_context` and exercise both missing-optional and present-optional paths without turning optional evidence into required evidence. 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 1928132..9510927 100644 --- a/docs/ci/runtime_intelligence_gitlab_artifacts.md +++ b/docs/ci/runtime_intelligence_gitlab_artifacts.md @@ -260,7 +260,11 @@ The same alignment artifact also preserves 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. +path. A companion +`aiguard_edgeenv_handoff_alignment_optional_present.json/.md` fixture exercises +the same optional labels when they are present, proving the gate can record +`optional_guard_evidence_types_present` without promoting those labels to +required deployment-decision evidence. 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_optional_present.json b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.json new file mode 100644 index 0000000..066a6c6 --- /dev/null +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.json @@ -0,0 +1,102 @@ +{ + "schema_version": "inferedge-aiguard-edgeenv-handoff-alignment-v1", + "status": "passed", + "recommendation": "alignment_satisfied", + "decision_owner": "lab", + "diagnosis_owner": "aiguard", + "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": 12, + "lab_expected_report_marker_count": 17, + "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_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", + "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", + "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": [], + "supplemental_guard_evidence_types": [ + "edgeenv_orchestrator_operation_risk_summary", + "edgeenv_orchestrator_stale_drop_summary", + "stale_frame_risk" + ], + "invalid_required_evidence_types": [], + "invalid_optional_evidence_types": [], + "invalid_guard_evidence_items": [], + "boundary_flags": { + "aiguard_guard_analysis_is_external": true, + "edgeenv_does_not_generate_guard_analysis": true, + "aiguard_is_final_decision_owner": false, + "lab_is_final_decision_owner": true, + "production_observability_platform": false + }, + "boundary_errors": [], + "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": [] +} 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 new file mode 100644 index 0000000..f5ded3c --- /dev/null +++ b/examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.md @@ -0,0 +1,62 @@ +# 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 | 12 | +| 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, 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 | [] | +| 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 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.] +- 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, 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, 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: [] +- 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] +``` diff --git a/scripts/check_runtime_intelligence_ci_artifacts.py b/scripts/check_runtime_intelligence_ci_artifacts.py index c7afc1a..1979bbf 100644 --- a/scripts/check_runtime_intelligence_ci_artifacts.py +++ b/scripts/check_runtime_intelligence_ci_artifacts.py @@ -16,11 +16,13 @@ } REQUIRED_SUMMARY_ARTIFACTS = { "aiguard_edgeenv_handoff_alignment.md", + "aiguard_edgeenv_handoff_alignment_optional_present.md", "runtime_intelligence_bundle_manifest_gate_summary.md", "runtime_anomaly_gate_summary.md", } REQUIRED_JSON_ARTIFACTS = { "aiguard_edgeenv_handoff_alignment.json", + "aiguard_edgeenv_handoff_alignment_optional_present.json", "portfolio_demo_check.json", "deployment_risk_summary.json", } @@ -105,12 +107,18 @@ "edgeenv_orchestrator_stale_drop_summary", "stale_frame_risk", ] +REQUIRED_AIGUARD_PRESENT_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", + "aiguard_optional_present_types: edgeenv_orchestrator_stale_drop_summary, stale_frame_risk", + "aiguard_optional_present_missing_types: none", ) REQUIRED_DURATION_TRACEABILITY_SUMMARY_MARKERS = ( "## Validated Duration Traceability", @@ -163,6 +171,10 @@ def _load_json(path: Path, errors: list[str], label: str) -> dict: return payload +def _format_markdown_inline_list(values: list[str]) -> str: + return f"[{', '.join(values)}]" if values else "[]" + + def _validate_required_files(report_dir: Path, errors: list[str]) -> None: for name in sorted( REQUIRED_MARKDOWN_ARTIFACTS @@ -297,7 +309,20 @@ def _validate_aiguard_handoff_alignment( json_path: Path, markdown_path: Path, errors: list[str], + *, + expected_optional_guard_evidence_types_present: list[str] | None = None, + expected_missing_optional_evidence_types: list[str] | None = None, ) -> None: + expected_optional_guard_evidence_types_present = ( + expected_optional_guard_evidence_types_present + if expected_optional_guard_evidence_types_present is not None + else [] + ) + expected_missing_optional_evidence_types = ( + expected_missing_optional_evidence_types + if expected_missing_optional_evidence_types is not None + else REQUIRED_AIGUARD_MISSING_OPTIONAL_EVIDENCE_TYPES + ) payload = _load_json(json_path, errors, "AIGuard EdgeEnv handoff alignment JSON") if payload: _record( @@ -360,13 +385,14 @@ def _validate_aiguard_handoff_alignment( "aiguard_edgeenv_handoff_alignment.json optional evidence types must match EdgeEnv handoff context", ) _record( - payload.get("optional_guard_evidence_types_present") == [], + payload.get("optional_guard_evidence_types_present") + == expected_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, + == expected_missing_optional_evidence_types, errors, "aiguard_edgeenv_handoff_alignment.json missing optional evidence types must remain read-only context", ) @@ -416,6 +442,12 @@ def _validate_aiguard_handoff_alignment( "AIGuard EdgeEnv handoff alignment Markdown", ) if text: + expected_present_marker = _format_markdown_inline_list( + expected_optional_guard_evidence_types_present + ) + expected_missing_marker = _format_markdown_inline_list( + expected_missing_optional_evidence_types + ) for marker in ( "status: passed", "decision_owner: lab", @@ -443,9 +475,8 @@ def _validate_aiguard_handoff_alignment( "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]", + f"optional_guard_evidence_types_present: {expected_present_marker}", + f"missing_optional_evidence_types: {expected_missing_marker}", "handoff_producer_lineage_guard_alignment_run_ids: " "[edgeenv-smoke-candidate, edgeenv-smoke-missing]", "guard_analysis_producer_lineage_guard_alignment_run_ids: " @@ -528,6 +559,15 @@ def main(report_dir: str, summary_out: str = "") -> int: report_path / "aiguard_edgeenv_handoff_alignment.md", errors, ) + _validate_aiguard_handoff_alignment( + report_path / "aiguard_edgeenv_handoff_alignment_optional_present.json", + report_path / "aiguard_edgeenv_handoff_alignment_optional_present.md", + errors, + expected_optional_guard_evidence_types_present=( + REQUIRED_AIGUARD_PRESENT_OPTIONAL_EVIDENCE_TYPES + ), + expected_missing_optional_evidence_types=[], + ) _validate_runtime_report(report_path / "runtime_anomaly_summary.md", errors) _validate_portfolio_status(report_path / "portfolio_demo_check.json", errors) _validate_deployment_risk_status( diff --git a/scripts/smoke_runtime_intelligence_chain.sh b/scripts/smoke_runtime_intelligence_chain.sh index dd4ac1f..432c83d 100755 --- a/scripts/smoke_runtime_intelligence_chain.sh +++ b/scripts/smoke_runtime_intelligence_chain.sh @@ -71,6 +71,10 @@ cp examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.json \ "$OUTPUT_DIR/aiguard_edgeenv_handoff_alignment.json" cp examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment.md \ "$OUTPUT_DIR/aiguard_edgeenv_handoff_alignment.md" +cp examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.json \ + "$OUTPUT_DIR/aiguard_edgeenv_handoff_alignment_optional_present.json" +cp examples/runtime_intelligence_chain/aiguard_edgeenv_handoff_alignment_optional_present.md \ + "$OUTPUT_DIR/aiguard_edgeenv_handoff_alignment_optional_present.md" "${LAB_CMD[@]}" compare \ examples/edgeenv_regression/lab_baseline_result.json \ diff --git a/tests/test_runtime_intelligence_ci_template.py b/tests/test_runtime_intelligence_ci_template.py index d339903..a6d0a0d 100644 --- a/tests/test_runtime_intelligence_ci_template.py +++ b/tests/test_runtime_intelligence_ci_template.py @@ -302,6 +302,71 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p ), encoding="utf-8", ) + ( + report_dir / "aiguard_edgeenv_handoff_alignment_optional_present.json" + ).write_text( + '{"schema_version":"inferedge-aiguard-edgeenv-handoff-alignment-v1",' + '"status":"passed","decision_owner":"lab","diagnosis_owner":"aiguard",' + '"lab_expected_report_marker_count":17,' + '"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_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":' + '["edgeenv_orchestrator_stale_drop_summary","stale_frame_risk"],' + '"missing_optional_evidence_types":[],' + '"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":' + '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' + '"guard_alignment_summary_errors":[],"errors":[]}', + encoding="utf-8", + ) + ( + report_dir / "aiguard_edgeenv_handoff_alignment_optional_present.md" + ).write_text( + "\n".join( + [ + "- 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.]", + "- 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: [edgeenv_orchestrator_stale_drop_summary, stale_frame_risk]", + "- missing_optional_evidence_types: []", + "- 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", + ) (report_dir / "portfolio_demo_check.md").write_text( "status: pass\n", encoding="utf-8", @@ -372,6 +437,11 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "aiguard_missing_optional_types: edgeenv_orchestrator_stale_drop_summary, stale_frame_risk" in summary ) + assert ( + "aiguard_optional_present_types: edgeenv_orchestrator_stale_drop_summary, stale_frame_risk" + in summary + ) + assert "aiguard_optional_present_missing_types: none" 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 1637d51..9e55cc0 100644 --- a/tests/test_runtime_intelligence_smoke_script.py +++ b/tests/test_runtime_intelligence_smoke_script.py @@ -52,6 +52,8 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): "runtime_intelligence_bundle_manifest_gate_summary.md", "aiguard_edgeenv_handoff_alignment.json", "aiguard_edgeenv_handoff_alignment.md", + "aiguard_edgeenv_handoff_alignment_optional_present.json", + "aiguard_edgeenv_handoff_alignment_optional_present.md", "edgeenv_runtime_regression.md", "edgeenv_runtime_regression.html", "runtime_anomaly_summary.md", @@ -186,6 +188,36 @@ 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 + optional_present_summary = ( + output_dir / "aiguard_edgeenv_handoff_alignment_optional_present.md" + ).read_text(encoding="utf-8") + optional_present_payload = json.loads( + ( + output_dir / "aiguard_edgeenv_handoff_alignment_optional_present.json" + ).read_text(encoding="utf-8") + ) + assert optional_present_payload["optional_evidence_context_role"] == ( + "read_only_optional_guard_context" + ) + assert ( + optional_present_payload["aiguard_validates_optional_evidence_as_required"] + is False + ) + assert optional_present_payload["optional_aiguard_evidence_types"] == [ + "stale_frame_risk", + "edgeenv_orchestrator_stale_drop_summary", + ] + assert optional_present_payload["optional_guard_evidence_types_present"] == [ + "edgeenv_orchestrator_stale_drop_summary", + "stale_frame_risk", + ] + assert optional_present_payload["missing_optional_evidence_types"] == [] + assert ( + "optional_guard_evidence_types_present: " + "[edgeenv_orchestrator_stale_drop_summary, stale_frame_risk]" + in optional_present_summary + ) + assert "missing_optional_evidence_types: []" in optional_present_summary ci_summary = ( output_dir / "runtime_intelligence_ci_artifact_gate_summary.md" @@ -208,6 +240,11 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): "aiguard_missing_optional_types: edgeenv_orchestrator_stale_drop_summary, stale_frame_risk" in ci_summary ) + assert ( + "aiguard_optional_present_types: edgeenv_orchestrator_stale_drop_summary, stale_frame_risk" + in ci_summary + ) + assert "aiguard_optional_present_missing_types: none" in ci_summary assert "## Validated Duration Traceability" in ci_summary assert ( "duration_handoff_alignment: EdgeEnv/AIGuard report context preserved"