From c1842a6e60669dc57558614e0c0bb92ac305a095 Mon Sep 17 00:00:00 2001 From: hyeokjun32 Date: Fri, 12 Jun 2026 01:19:08 +0900 Subject: [PATCH] Link optional AIGuard source artifact --- .../runtime_intelligence_gitlab_artifacts.md | 7 +++- ...nv_handoff_alignment_optional_present.json | 7 ++++ ...eenv_handoff_alignment_optional_present.md | 2 + ...check_runtime_intelligence_ci_artifacts.py | 37 ++++++++++++++++++- .../test_runtime_intelligence_ci_template.py | 13 +++++++ .../test_runtime_intelligence_smoke_script.py | 22 +++++++++++ 6 files changed, 85 insertions(+), 3 deletions(-) diff --git a/docs/ci/runtime_intelligence_gitlab_artifacts.md b/docs/ci/runtime_intelligence_gitlab_artifacts.md index 9510927..431540d 100644 --- a/docs/ci/runtime_intelligence_gitlab_artifacts.md +++ b/docs/ci/runtime_intelligence_gitlab_artifacts.md @@ -264,7 +264,12 @@ 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. +required deployment-decision evidence. That optional-present fixture also +records the source as +`InferEdgeAIGuard/examples/runtime_intelligence/aiguard_runtime_operation_guard_analysis_optional_stale_drop.json` +so reviewers can trace Lab's optional-present handoff fixture back to the +AIGuard full-evidence example without making that cross-repo path a required +runtime contract. 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 index 066a6c6..aa37dfc 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 @@ -73,6 +73,13 @@ "stale_frame_risk" ], "missing_optional_evidence_types": [], + "optional_present_source_artifact": { + "repository": "InferEdgeAIGuard", + "path": "examples/runtime_intelligence/aiguard_runtime_operation_guard_analysis_optional_stale_drop.json", + "schema_version": "inferedge-aiguard-diagnosis-v1", + "role": "aiguard-optional-stale-drop-full-evidence-source", + "context_role": "read_only_cross_repo_traceability" + }, "supplemental_guard_evidence_types": [ "edgeenv_orchestrator_operation_risk_summary", "edgeenv_orchestrator_stale_drop_summary", 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 f5ded3c..5b4e874 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 @@ -29,6 +29,7 @@ | 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 | | 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 | [] | @@ -56,6 +57,7 @@ InferEdgeAIGuard EdgeEnv handoff alignment 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 - 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 1979bbf..e412f01 100644 --- a/scripts/check_runtime_intelligence_ci_artifacts.py +++ b/scripts/check_runtime_intelligence_ci_artifacts.py @@ -111,6 +111,20 @@ "edgeenv_orchestrator_stale_drop_summary", "stale_frame_risk", ] +REQUIRED_AIGUARD_OPTIONAL_PRESENT_SOURCE_ARTIFACT = { + "repository": "InferEdgeAIGuard", + "path": ( + "examples/runtime_intelligence/" + "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" + ), + "schema_version": "inferedge-aiguard-diagnosis-v1", + "role": "aiguard-optional-stale-drop-full-evidence-source", + "context_role": "read_only_cross_repo_traceability", +} +REQUIRED_AIGUARD_OPTIONAL_PRESENT_SOURCE_ARTIFACT_MARKER = ( + "InferEdgeAIGuard/examples/runtime_intelligence/" + "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" +) REQUIRED_AIGUARD_OPTIONAL_CONTEXT_SUMMARY_MARKERS = ( "## Validated AIGuard Optional Handoff Context", "aiguard_optional_context: read_only_optional_guard_context preserved", @@ -119,6 +133,8 @@ "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", + "aiguard_optional_present_source_artifact: " + f"{REQUIRED_AIGUARD_OPTIONAL_PRESENT_SOURCE_ARTIFACT_MARKER}", ) REQUIRED_DURATION_TRACEABILITY_SUMMARY_MARKERS = ( "## Validated Duration Traceability", @@ -312,6 +328,7 @@ def _validate_aiguard_handoff_alignment( *, expected_optional_guard_evidence_types_present: list[str] | None = None, expected_missing_optional_evidence_types: list[str] | None = None, + expected_optional_present_source_artifact: dict[str, str] | None = None, ) -> None: expected_optional_guard_evidence_types_present = ( expected_optional_guard_evidence_types_present @@ -401,6 +418,13 @@ def _validate_aiguard_handoff_alignment( errors, "aiguard_edgeenv_handoff_alignment.json invalid_optional_evidence_types must be empty", ) + if expected_optional_present_source_artifact is not None: + _record( + payload.get("optional_present_source_artifact") + == expected_optional_present_source_artifact, + errors, + "aiguard_edgeenv_handoff_alignment.json optional-present source artifact must point to the AIGuard full evidence example", + ) _record( payload.get("lab_expected_report_marker_count") == len(REQUIRED_LAB_EXPECTED_REPORT_MARKERS), @@ -448,7 +472,7 @@ def _validate_aiguard_handoff_alignment( expected_missing_marker = _format_markdown_inline_list( expected_missing_optional_evidence_types ) - for marker in ( + expected_markers = [ "status: passed", "decision_owner: lab", "diagnosis_owner: aiguard", @@ -481,7 +505,13 @@ def _validate_aiguard_handoff_alignment( "[edgeenv-smoke-candidate, edgeenv-smoke-missing]", "guard_analysis_producer_lineage_guard_alignment_run_ids: " "[edgeenv-smoke-candidate, edgeenv-smoke-missing]", - ): + ] + if expected_optional_present_source_artifact is not None: + expected_markers.append( + "optional_present_source_artifact: " + f"{REQUIRED_AIGUARD_OPTIONAL_PRESENT_SOURCE_ARTIFACT_MARKER}" + ) + for marker in expected_markers: _record( marker in text, errors, @@ -567,6 +597,9 @@ def main(report_dir: str, summary_out: str = "") -> int: REQUIRED_AIGUARD_PRESENT_OPTIONAL_EVIDENCE_TYPES ), expected_missing_optional_evidence_types=[], + expected_optional_present_source_artifact=( + REQUIRED_AIGUARD_OPTIONAL_PRESENT_SOURCE_ARTIFACT + ), ) _validate_runtime_report(report_path / "runtime_anomaly_summary.md", errors) _validate_portfolio_status(report_path / "portfolio_demo_check.json", errors) diff --git a/tests/test_runtime_intelligence_ci_template.py b/tests/test_runtime_intelligence_ci_template.py index a6d0a0d..ef85e78 100644 --- a/tests/test_runtime_intelligence_ci_template.py +++ b/tests/test_runtime_intelligence_ci_template.py @@ -337,6 +337,12 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p '"optional_guard_evidence_types_present":' '["edgeenv_orchestrator_stale_drop_summary","stale_frame_risk"],' '"missing_optional_evidence_types":[],' + '"optional_present_source_artifact":{' + '"repository":"InferEdgeAIGuard",' + '"path":"examples/runtime_intelligence/aiguard_runtime_operation_guard_analysis_optional_stale_drop.json",' + '"schema_version":"inferedge-aiguard-diagnosis-v1",' + '"role":"aiguard-optional-stale-drop-full-evidence-source",' + '"context_role":"read_only_cross_repo_traceability"},' '"invalid_optional_evidence_types":[],' '"handoff_producer_lineage_guard_alignment_run_ids":' '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' @@ -361,6 +367,7 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "- 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: []", + "- optional_present_source_artifact: InferEdgeAIGuard/examples/runtime_intelligence/aiguard_runtime_operation_guard_analysis_optional_stale_drop.json", "- handoff_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing]", "- guard_analysis_producer_lineage_guard_alignment_run_ids: [edgeenv-smoke-candidate, edgeenv-smoke-missing]", ] @@ -442,6 +449,12 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p in summary ) assert "aiguard_optional_present_missing_types: none" in summary + assert ( + "aiguard_optional_present_source_artifact: " + "InferEdgeAIGuard/examples/runtime_intelligence/" + "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" + 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 9e55cc0..6ef06e5 100644 --- a/tests/test_runtime_intelligence_smoke_script.py +++ b/tests/test_runtime_intelligence_smoke_script.py @@ -212,12 +212,28 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): "stale_frame_risk", ] assert optional_present_payload["missing_optional_evidence_types"] == [] + assert optional_present_payload["optional_present_source_artifact"] == { + "repository": "InferEdgeAIGuard", + "path": ( + "examples/runtime_intelligence/" + "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" + ), + "schema_version": "inferedge-aiguard-diagnosis-v1", + "role": "aiguard-optional-stale-drop-full-evidence-source", + "context_role": "read_only_cross_repo_traceability", + } 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 + assert ( + "optional_present_source_artifact: " + "InferEdgeAIGuard/examples/runtime_intelligence/" + "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" + in optional_present_summary + ) ci_summary = ( output_dir / "runtime_intelligence_ci_artifact_gate_summary.md" @@ -245,6 +261,12 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): in ci_summary ) assert "aiguard_optional_present_missing_types: none" in ci_summary + assert ( + "aiguard_optional_present_source_artifact: " + "InferEdgeAIGuard/examples/runtime_intelligence/" + "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" + in ci_summary + ) assert "## Validated Duration Traceability" in ci_summary assert ( "duration_handoff_alignment: EdgeEnv/AIGuard report context preserved"