From 187e60fed49b54a483743b3317fbd3a15f81912d Mon Sep 17 00:00:00 2001 From: hyeokjun32 Date: Fri, 12 Jun 2026 09:31:49 +0900 Subject: [PATCH] Record AIGuard optional evidence regeneration path --- .../runtime_intelligence_gitlab_artifacts.md | 6 +- ...nv_handoff_alignment_optional_present.json | 16 ++++- ...eenv_handoff_alignment_optional_present.md | 2 + ...check_runtime_intelligence_ci_artifacts.py | 38 ++++++++++-- ...st_runtime_intelligence_bundle_manifest.py | 6 ++ .../test_runtime_intelligence_ci_template.py | 31 +++++++++- .../test_runtime_intelligence_smoke_script.py | 60 +++++++++++++++++++ 7 files changed, 152 insertions(+), 7 deletions(-) diff --git a/docs/ci/runtime_intelligence_gitlab_artifacts.md b/docs/ci/runtime_intelligence_gitlab_artifacts.md index 431540d..890cdbe 100644 --- a/docs/ci/runtime_intelligence_gitlab_artifacts.md +++ b/docs/ci/runtime_intelligence_gitlab_artifacts.md @@ -269,7 +269,11 @@ 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. +runtime contract. It also records the AIGuard-side reproduction command, +`python -m inferedge_aiguard.cli build-runtime-intelligence-optional-stale-drop`, +as read-only traceability so the source artifact can be regenerated from +committed AIGuard source fixtures while Lab remains the report and deployment +decision owner. 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 aa37dfc..8406ddb 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 @@ -78,7 +78,21 @@ "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" + "context_role": "read_only_cross_repo_traceability", + "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", 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 5b4e874..8680242 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 @@ -30,6 +30,7 @@ | 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 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 | [] | @@ -58,6 +59,7 @@ InferEdgeAIGuard EdgeEnv handoff alignment 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 +- 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] - 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 e412f01..bd67121 100644 --- a/scripts/check_runtime_intelligence_ci_artifacts.py +++ b/scripts/check_runtime_intelligence_ci_artifacts.py @@ -111,6 +111,33 @@ "edgeenv_orchestrator_stale_drop_summary", "stale_frame_risk", ] +REQUIRED_AIGUARD_OPTIONAL_PRESENT_SOURCE_ARTIFACT_MARKER = ( + "InferEdgeAIGuard/examples/runtime_intelligence/" + "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" +) +REQUIRED_AIGUARD_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" + ), +] +REQUIRED_AIGUARD_OPTIONAL_PRESENT_REPRODUCTION_COMMAND_MARKER = " ".join( + REQUIRED_AIGUARD_OPTIONAL_PRESENT_REPRODUCTION_COMMAND +) REQUIRED_AIGUARD_OPTIONAL_PRESENT_SOURCE_ARTIFACT = { "repository": "InferEdgeAIGuard", "path": ( @@ -120,11 +147,8 @@ "schema_version": "inferedge-aiguard-diagnosis-v1", "role": "aiguard-optional-stale-drop-full-evidence-source", "context_role": "read_only_cross_repo_traceability", + "reproduction_command": REQUIRED_AIGUARD_OPTIONAL_PRESENT_REPRODUCTION_COMMAND, } -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", @@ -135,6 +159,8 @@ "aiguard_optional_present_missing_types: none", "aiguard_optional_present_source_artifact: " f"{REQUIRED_AIGUARD_OPTIONAL_PRESENT_SOURCE_ARTIFACT_MARKER}", + "aiguard_optional_present_reproduction_command: " + f"{REQUIRED_AIGUARD_OPTIONAL_PRESENT_REPRODUCTION_COMMAND_MARKER}", ) REQUIRED_DURATION_TRACEABILITY_SUMMARY_MARKERS = ( "## Validated Duration Traceability", @@ -511,6 +537,10 @@ def _validate_aiguard_handoff_alignment( "optional_present_source_artifact: " f"{REQUIRED_AIGUARD_OPTIONAL_PRESENT_SOURCE_ARTIFACT_MARKER}" ) + expected_markers.append( + "optional_present_reproduction_command: " + f"{REQUIRED_AIGUARD_OPTIONAL_PRESENT_REPRODUCTION_COMMAND_MARKER}" + ) for marker in expected_markers: _record( marker in text, diff --git a/tests/test_runtime_intelligence_bundle_manifest.py b/tests/test_runtime_intelligence_bundle_manifest.py index 6bf88f5..4ef6f3a 100644 --- a/tests/test_runtime_intelligence_bundle_manifest.py +++ b/tests/test_runtime_intelligence_bundle_manifest.py @@ -167,6 +167,12 @@ def test_runtime_intelligence_docs_describe_expected_report_markers(): assert "Lab-owned Runtime Intelligence report contract" in doc for marker in REQUIRED_EXPECTED_REPORT_MARKERS: assert marker in doc + assert "build-runtime-intelligence-optional-stale-drop" in ci_doc + assert ( + "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" + in ci_doc + ) + assert "committed AIGuard source fixtures" in ci_doc def test_runtime_intelligence_docs_record_jetson_edgeenv_preservation_boundary(): diff --git a/tests/test_runtime_intelligence_ci_template.py b/tests/test_runtime_intelligence_ci_template.py index ef85e78..cb0abb6 100644 --- a/tests/test_runtime_intelligence_ci_template.py +++ b/tests/test_runtime_intelligence_ci_template.py @@ -342,7 +342,18 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p '"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"},' + '"context_role":"read_only_cross_repo_traceability",' + '"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"]},' '"invalid_optional_evidence_types":[],' '"handoff_producer_lineage_guard_alignment_run_ids":' '["edgeenv-smoke-candidate","edgeenv-smoke-missing"],' @@ -368,6 +379,7 @@ 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: 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", "- 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]", ] @@ -455,6 +467,23 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" in summary ) + assert ( + "aiguard_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" + 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 6ef06e5..d20aa62 100644 --- a/tests/test_runtime_intelligence_smoke_script.py +++ b/tests/test_runtime_intelligence_smoke_script.py @@ -221,6 +221,32 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): "schema_version": "inferedge-aiguard-diagnosis-v1", "role": "aiguard-optional-stale-drop-full-evidence-source", "context_role": "read_only_cross_repo_traceability", + "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" + ), + ], } assert ( "optional_guard_evidence_types_present: " @@ -234,6 +260,23 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" in optional_present_summary ) + assert ( + "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" + in optional_present_summary + ) ci_summary = ( output_dir / "runtime_intelligence_ci_artifact_gate_summary.md" @@ -267,6 +310,23 @@ def test_runtime_intelligence_smoke_script_runs_artifact_chain(tmp_path): "aiguard_runtime_operation_guard_analysis_optional_stale_drop.json" in ci_summary ) + assert ( + "aiguard_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" + in ci_summary + ) assert "## Validated Duration Traceability" in ci_summary assert ( "duration_handoff_alignment: EdgeEnv/AIGuard report context preserved"