From 2d665e8c5969b982c0b6d73b990921cb21dd8028 Mon Sep 17 00:00:00 2001 From: hyeokjun32 Date: Mon, 1 Jun 2026 15:04:53 +0900 Subject: [PATCH] feat: surface AIGuard max queue traceability --- README.md | 2 + .../runtime_intelligence_gitlab_artifacts.md | 6 +- .../edgeenv_runtime_regression_lab_handoff.md | 8 + inferedgelab/report/runtime_intelligence.py | 151 ++++++++++++++++++ ...ck_runtime_intelligence_artifact_bundle.py | 12 ++ ...check_runtime_intelligence_ci_artifacts.py | 3 + tests/test_compare_service.py | 13 ++ tests/test_report_generators.py | 19 +++ .../test_runtime_intelligence_ci_template.py | 13 ++ ...ntime_intelligence_evidence_chain_smoke.py | 14 ++ 10 files changed, 239 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 20a21ad..4432cd1 100644 --- a/README.md +++ b/README.md @@ -502,6 +502,7 @@ If AIGuard preserves EdgeEnv/Orchestrator `candidate_context.producer` lineage, If EdgeEnv preserves an Orchestrator `operation_risk_summary`, Lab shows the compact queue-pressure, max-pressure task, worker-health, and producer/device-local event markers as navigation context in the Runtime Intelligence Risk Summary. These markers help reviewers find the relevant operation evidence, but they do not become EdgeEnv regression deltas, comparability fields, or a deployment decision override. Lab also renders a separate `Orchestrator queue/deadline/fallback markers` row when those compact counters are present. That row keeps `queue_pressure_reason`, `max_total_queue_depth` when available, deadline miss count, and fallback count together so reviewers can spot operation pressure before reading the detailed task rollup. +When AIGuard raw context preserves `orchestrator_candidate_operation_max_total_queue_depth`, Lab also renders an `AIGuard max queue raw-context traceability` row. This ties the visible `max_total_queue_depth` report marker back to deterministic AIGuard context and Orchestrator operation evidence without changing Lab's deployment decision ownership. When EdgeEnv/Orchestrator context includes reviewer-facing duration metadata, Lab renders a `Runtime replay duration scope` row with `duration_label`, @@ -539,6 +540,7 @@ Markdown and HTML reports include a Runtime Intelligence Risk Summary that conne - Runtime history seed and run_config traceability - Orchestrator operation risk summary markers - compact queue/deadline/fallback operation markers with `max_total_queue_depth` +- AIGuard raw-context traceability for `max_total_queue_depth` - Lab EdgeEnv preservation context markers - device-local producer lineage handoff - Orchestrator-declared downstream guard alignment diff --git a/docs/ci/runtime_intelligence_gitlab_artifacts.md b/docs/ci/runtime_intelligence_gitlab_artifacts.md index 4dc2053..5ed6272 100644 --- a/docs/ci/runtime_intelligence_gitlab_artifacts.md +++ b/docs/ci/runtime_intelligence_gitlab_artifacts.md @@ -186,13 +186,15 @@ EdgeEnv handoff summary and AIGuard deterministic evidence agree on producer-lineage guard-alignment run IDs. This keeps the cross-repo marker check file-based and does not make AIGuard a deployment decision owner. -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 Lab ownership, EdgeEnv comparability, telemetry coverage-gap markers, Runtime replay duration scope with `source=entrypoint_requested_frames` traceability, Orchestrator operation feed context, compact queue/deadline/fallback operation markers with `max_total_queue_depth`, 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_task_event_rollup` 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 Lab ownership, EdgeEnv comparability, telemetry coverage-gap markers, Runtime replay duration scope with `source=entrypoint_requested_frames` traceability, Orchestrator operation feed context, 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_task_event_rollup` 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 `orchestrator_candidate_operation_max_total_queue_depth=7` in `raw_context.edgeenv_regression`, so the Lab `max_total_queue_depth` report row -can be traced back to Orchestrator producer-side operation context. +can be traced back to Orchestrator producer-side operation context. The report +now surfaces that check as `AIGuard max queue raw-context traceability`, keeping +the reviewer-facing row easy to identify in Markdown/HTML artifacts. When that report gate passes, its summary now emits a `Validated Duration Traceability` section with `duration_handoff_alignment`, `duration_source: source=entrypoint_requested_frames`, diff --git a/docs/portfolio/edgeenv_runtime_regression_lab_handoff.md b/docs/portfolio/edgeenv_runtime_regression_lab_handoff.md index 7a9dcb2..311edac 100644 --- a/docs/portfolio/edgeenv_runtime_regression_lab_handoff.md +++ b/docs/portfolio/edgeenv_runtime_regression_lab_handoff.md @@ -181,6 +181,10 @@ Expected Lab behavior: `orchestrator_candidate_operation_max_total_queue_depth=7`, keeping the rendered Lab `max_total_queue_depth` row traceable to Orchestrator's producer-side operation context. +- Lab now renders that link as `AIGuard max queue raw-context traceability`, + with the visible report value and the AIGuard raw-context value side by side + so reviewers can identify the preservation path without treating it as a + deployment decision override. - The same gate summary emits `expected_report_markers: remote fallback Lab context row declared`, keeping the remote fallback row-value marker visible in file-based CI artifacts without making CI a runtime control plane. - The same handoff gate verifies that the referenced `runtime_telemetry_history` artifact exists and preserves EdgeEnv history schema, telemetry coverage, and Runtime history seed ownership markers. - The same handoff gate verifies that missing telemetry entries remain evidence gaps while preserving Orchestrator producer markers, owner boundary flags, and EdgeEnv mapping hints when Orchestrator context is attached. @@ -194,6 +198,10 @@ Expected Lab behavior: - Markdown/HTML reports include a `Runtime Intelligence Risk Summary` that summarizes EdgeEnv comparability/regression, telemetry replay gaps, Runtime history seed/run_config traceability, AIGuard deterministic evidence, and the Lab-owned deployment decision in one reviewer-facing table. - When EdgeEnv includes preserved Orchestrator feed context, the `Runtime Intelligence Risk Summary` surfaces queue, thermal, throttling, memory, fallback context, and compact `operation_risk_summary` markers as supplemental runtime evidence. - Lab now keeps queue pressure, `max_total_queue_depth` when available, deadline miss count, and fallback count together in an `Orchestrator queue/deadline/fallback markers` row when those compact counters are present. This is reviewer navigation context, not a production scheduler state or deployment decision override. +- Lab also surfaces `AIGuard max queue raw-context traceability` when AIGuard + preserves the same `orchestrator_candidate_operation_max_total_queue_depth` + value, making the report row traceable back to deterministic AIGuard raw + context and Orchestrator operation evidence. - When EdgeEnv includes replay duration metadata, the same Risk Summary surfaces `Runtime replay duration scope` with `duration_label`, `duration_class`, frame count, and optional `duration_source` / `duration_scope_label` traceability as reviewer navigation context. This does not change EdgeEnv comparability or Lab deployment policy. - The report artifact gate summary also emits a `Validated Duration Traceability` section so reviewers can see `duration_handoff_alignment`, diff --git a/inferedgelab/report/runtime_intelligence.py b/inferedgelab/report/runtime_intelligence.py index 272729e..7118cc2 100644 --- a/inferedgelab/report/runtime_intelligence.py +++ b/inferedgelab/report/runtime_intelligence.py @@ -124,6 +124,12 @@ def build_runtime_intelligence_risk_rows( warning_items, evidence_items, ) + _append_aiguard_max_queue_traceability_row( + rows, + edgeenv_regression, + evidence_items, + guard_analysis, + ) _append_aiguard_remote_dispatch_rows(rows, guard_analysis, evidence_items) _append_aiguard_run_config_traceability_row(rows, evidence_items) @@ -915,6 +921,151 @@ def _append_aiguard_runtime_operation_rows( ) +def _append_aiguard_max_queue_traceability_row( + rows: list[tuple[str, str, str]], + edgeenv_regression: dict[str, Any] | None, + evidence_items: list[dict[str, Any]], + guard_analysis: dict[str, Any], +) -> None: + label = _aiguard_max_queue_traceability_label( + edgeenv_regression, + evidence_items, + guard_analysis, + ) + if not label: + return + + rows.append( + ( + "AIGuard max queue raw-context traceability", + label, + ( + "The visible Lab max_total_queue_depth marker is traceable " + "through AIGuard raw context to Orchestrator operation evidence; " + "it remains review context, not a decision override." + ), + ) + ) + + +def _aiguard_max_queue_traceability_label( + edgeenv_regression: dict[str, Any] | None, + evidence_items: list[dict[str, Any]], + guard_analysis: dict[str, Any], +) -> str: + report_values: dict[str, Any] = {} + if isinstance(edgeenv_regression, dict): + telemetry_context = edgeenv_regression.get("runtime_telemetry_context") + if isinstance(telemetry_context, dict): + report_values = _orchestrator_max_queue_depth_by_run(telemetry_context) + + raw_values = _aiguard_max_queue_raw_context_by_run( + evidence_items, + guard_analysis, + ) + if not report_values or not raw_values: + return "" + + labels: list[str] = [] + for run_label in ("baseline", "candidate"): + report_value = report_values.get(run_label) + raw_value = raw_values.get(run_label) + if report_value is None or raw_value is None: + continue + labels.append( + ( + f"{run_label}: report=max_total_queue_depth=" + f"{_format_compact_value(report_value)}, " + f"raw_context=orchestrator_{run_label}_operation_" + "max_total_queue_depth=" + f"{_format_compact_value(raw_value)}, " + f"match={_compact_values_match(report_value, raw_value)}" + ) + ) + return "; ".join(labels) + + +def _orchestrator_max_queue_depth_by_run( + context: dict[str, Any], +) -> dict[str, Any]: + values: dict[str, Any] = {} + for run_label in ("baseline", "candidate"): + run_context = context.get(run_label) + if not isinstance(run_context, dict): + continue + operation_context = run_context.get("orchestrator_operation_context") + if not isinstance(operation_context, dict): + continue + + candidate_context = operation_context.get("candidate_context") + if not isinstance(candidate_context, dict): + candidate_context = {} + operation = candidate_context.get("operation") + if not isinstance(operation, dict): + operation = {} + operation_summary = operation_context.get("operation_risk_summary") + if not isinstance(operation_summary, dict): + operation_summary = {} + queue_state = operation_context.get("queue_state_summary") + if not isinstance(queue_state, dict): + queue_state = {} + + value = _first_present( + operation_summary.get("max_total_queue_depth"), + queue_state.get("max_total_queue_depth"), + operation.get("max_total_queue_depth"), + candidate_context.get("max_total_queue_depth"), + ) + if value is not None: + values[run_label] = value + return values + + +def _aiguard_max_queue_raw_context_by_run( + evidence_items: list[dict[str, Any]], + guard_analysis: dict[str, Any], +) -> dict[str, Any]: + values: dict[str, Any] = {} + for edgeenv_metrics in _aiguard_edgeenv_metric_sources( + evidence_items, + guard_analysis, + ): + for run_label in ("baseline", "candidate"): + field = f"orchestrator_{run_label}_operation_max_total_queue_depth" + value = edgeenv_metrics.get(field) + if value is not None and run_label not in values: + values[run_label] = value + return values + + +def _aiguard_edgeenv_metric_sources( + evidence_items: list[dict[str, Any]], + guard_analysis: dict[str, Any], +) -> list[dict[str, Any]]: + sources: list[dict[str, Any]] = [] + for item in evidence_items: + raw_context = item.get("raw_context") + if not isinstance(raw_context, dict): + continue + edgeenv_metrics = raw_context.get("edgeenv_regression") + if isinstance(edgeenv_metrics, dict): + sources.append(edgeenv_metrics) + + candidate_summary = guard_analysis.get("candidate_summary") + if isinstance(candidate_summary, dict): + edgeenv_metrics = candidate_summary.get("edgeenv_regression") + if isinstance(edgeenv_metrics, dict): + sources.append(edgeenv_metrics) + return sources + + +def _compact_values_match(left: Any, right: Any) -> bool: + try: + return float(left) == float(right) + except (TypeError, ValueError): + return str(left) == str(right) + + def _append_aiguard_run_config_traceability_row( rows: list[tuple[str, str, str]], evidence_items: list[dict[str, Any]], diff --git a/scripts/check_runtime_intelligence_artifact_bundle.py b/scripts/check_runtime_intelligence_artifact_bundle.py index c48198a..c8034b7 100644 --- a/scripts/check_runtime_intelligence_artifact_bundle.py +++ b/scripts/check_runtime_intelligence_artifact_bundle.py @@ -103,6 +103,12 @@ "aiguard_producer_lineage_handoff": ( "| AIGuard producer lineage handoff | sources=device_local_cli_override" ), + "aiguard_max_queue_traceability": ( + "| AIGuard max queue raw-context traceability | candidate: " + "report=max_total_queue_depth=7, " + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7, " + "match=True |" + ), "aiguard_producer_lineage_evidence": "edgeenv_orchestrator_producer_lineage", "aiguard_producer_lineage_recommendation": ( "Device-local Orchestrator producer lineage is preserved" @@ -175,6 +181,12 @@ "lab_edgeenv_registry_marker": "lab_preservation=present", "orchestrator_operation_risk_queue": "queue=queue_backlog_threshold_exceeded", "aiguard_producer_lineage_handoff": "AIGuard producer lineage handoff", + "aiguard_max_queue_traceability": ( + "AIGuard max queue raw-context traceability" + ), + "aiguard_max_queue_traceability_value": ( + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7" + ), "aiguard_producer_lineage_evidence": "edgeenv_orchestrator_producer_lineage", "aiguard_producer_lineage_recommendation": ( "Device-local Orchestrator producer lineage is preserved" diff --git a/scripts/check_runtime_intelligence_ci_artifacts.py b/scripts/check_runtime_intelligence_ci_artifacts.py index 611d88a..28bdfd9 100644 --- a/scripts/check_runtime_intelligence_ci_artifacts.py +++ b/scripts/check_runtime_intelligence_ci_artifacts.py @@ -55,6 +55,7 @@ "aiguard_raw_context: downstream_guard_alignment preserved", "aiguard_raw_context: producer_lineage_guard_alignment preserved", "aiguard_raw_context: missing_telemetry_orchestrator_context preserved", + "aiguard_raw_context: max_total_queue_depth traceability preserved", "aiguard_handoff_alignment: external required evidence types satisfied", "expected_report_markers: Runtime Intelligence report markers declared", "expected_report_markers: remote fallback Lab context row declared", @@ -184,6 +185,8 @@ def _validate_runtime_report(path: Path, errors: list[str]) -> None: "Orchestrator queue/deadline/fallback markers", "queue_pressure_reason=queue_backlog_threshold_exceeded", "max_total_queue_depth=7", + "AIGuard max queue raw-context traceability", + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7", "AIGuard producer-lineage guard alignment", "edgeenv_orchestrator_producer_lineage", "AIGuard run_config traceability evidence", diff --git a/tests/test_compare_service.py b/tests/test_compare_service.py index 94f70da..250eea4 100644 --- a/tests/test_compare_service.py +++ b/tests/test_compare_service.py @@ -554,6 +554,11 @@ def make_edgeenv_orchestrator_context_guard_analysis() -> dict: "why_it_matters": "Queue backlog can inflate runtime latency.", "suspected_causes": ["queue_overload", "scheduler_contention"], "recommendation": "Review Orchestrator queue policy.", + "raw_context": { + "edgeenv_regression": { + "orchestrator_candidate_operation_max_total_queue_depth": 7.0, + }, + }, }, ], "suspected_causes": ["thermal_pressure", "queue_overload"], @@ -563,6 +568,7 @@ def make_edgeenv_orchestrator_context_guard_analysis() -> dict: "history_orchestrator_feed_runs": 1.0, "candidate_orchestrator_context_present": True, "candidate_queue_depth": 7.0, + "orchestrator_candidate_operation_max_total_queue_depth": 7.0, "candidate_max_temperature_c": 78.5, "candidate_throttling_detected": True, } @@ -810,6 +816,12 @@ def fake_analyze_edgeenv_regression_report(report): "| Orchestrator queue/deadline/fallback markers | candidate: " "max_total_queue_depth=7, deadline_missed_count=2, fallback_count=1 |" ) in bundle["markdown"] + assert ( + "| AIGuard max queue raw-context traceability | candidate: " + "report=max_total_queue_depth=7, " + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7, " + "match=True |" + ) in bundle["markdown"] assert "| Orchestrator task event rollup | candidate: " in bundle["markdown"] assert "vision_agent(delay=1,miss=1,max_delay_cycles=3,max_wait_ms=15)" in bundle[ "markdown" @@ -824,6 +836,7 @@ def fake_analyze_edgeenv_regression_report(report): ] assert "AIGuard does not own the final decision" in bundle["markdown"] assert "AIGuard Orchestrator context handoff" in bundle["html"] + assert "AIGuard max queue raw-context traceability" in bundle["html"] assert "supplemental operation evidence" in bundle["html"] diff --git a/tests/test_report_generators.py b/tests/test_report_generators.py index d0eef95..f0de8a3 100644 --- a/tests/test_report_generators.py +++ b/tests/test_report_generators.py @@ -459,6 +459,11 @@ def make_runtime_operation_guard_analysis() -> dict: "why_it_matters": "Queue backlog can inflate runtime latency.", "suspected_causes": ["queue_overload", "scheduler_contention"], "recommendation": "Review Orchestrator queue policy.", + "raw_context": { + "edgeenv_regression": { + "orchestrator_candidate_operation_max_total_queue_depth": 7.0, + }, + }, }, { "type": "runtime_history_seed_run_config_traceability", @@ -564,6 +569,7 @@ def make_runtime_operation_guard_analysis() -> dict: "jetson_clocks": "unknown", }, "candidate_queue_depth": 7.0, + "orchestrator_candidate_operation_max_total_queue_depth": 7.0, "candidate_max_temperature_c": 78.5, "candidate_throttling_detected": True, "orchestrator_guard_alignment_producer_lineage_evidence_type": ( @@ -853,6 +859,12 @@ def test_generate_compare_markdown_summarizes_orchestrator_context_risk(): "queue_pressure_reason=queue_backlog_threshold_exceeded, " "max_total_queue_depth=7, deadline_missed_count=2, fallback_count=1 |" ) in text + assert ( + "| AIGuard max queue raw-context traceability | candidate: " + "report=max_total_queue_depth=7, " + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7, " + "match=True |" + ) in text assert ( "| Runtime replay duration scope | candidate: " "scope_label=source=entrypoint_requested_frames, " @@ -920,6 +932,7 @@ def test_generate_compare_html_summarizes_operation_risk_summary(): html = generate_compare_html( compare_result, judgement, + guard_analysis=make_runtime_operation_guard_analysis(), edgeenv_regression=make_edgeenv_regression_with_orchestrator_context(), ) @@ -934,6 +947,12 @@ def test_generate_compare_html_summarizes_operation_risk_summary(): "queue_pressure_reason=queue_backlog_threshold_exceeded, " "max_total_queue_depth=7, deadline_missed_count=2, fallback_count=1" ) in html + assert "AIGuard max queue raw-context traceability" in html + assert ( + "report=max_total_queue_depth=7, " + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7, " + "match=True" + ) in html assert "Orchestrator task event rollup" in html assert "vision_agent(delay=1,miss=1,max_delay_cycles=3,max_wait_ms=15)" in html assert "queue=queue_backlog_threshold_exceeded" in html diff --git a/tests/test_runtime_intelligence_ci_template.py b/tests/test_runtime_intelligence_ci_template.py index 984b0fa..829470f 100644 --- a/tests/test_runtime_intelligence_ci_template.py +++ b/tests/test_runtime_intelligence_ci_template.py @@ -123,6 +123,8 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "Orchestrator queue/deadline/fallback markers", "queue_pressure_reason=queue_backlog_threshold_exceeded", "max_total_queue_depth=7", + "AIGuard max queue raw-context traceability", + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7", "AIGuard producer-lineage guard alignment", "edgeenv_orchestrator_producer_lineage", "AIGuard run_config traceability evidence", @@ -173,6 +175,7 @@ def test_runtime_intelligence_ci_artifact_gate_passes_for_expected_outputs(tmp_p "- aiguard_raw_context: downstream_guard_alignment preserved", "- aiguard_raw_context: producer_lineage_guard_alignment preserved", "- aiguard_raw_context: missing_telemetry_orchestrator_context preserved", + "- aiguard_raw_context: max_total_queue_depth traceability preserved", "- aiguard_handoff_alignment: external required evidence types satisfied", "- expected_report_markers: Runtime Intelligence report markers declared", "- expected_report_markers: remote fallback Lab context row declared", @@ -363,6 +366,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_lab_marker_cont "Orchestrator queue/deadline/fallback markers", "queue_pressure_reason=queue_backlog_threshold_exceeded", "max_total_queue_depth=7", + "AIGuard max queue raw-context traceability", + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7", "AIGuard producer-lineage guard alignment", "edgeenv_orchestrator_producer_lineage", "AIGuard run_config traceability evidence", @@ -413,6 +418,7 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_lab_marker_cont "- aiguard_raw_context: downstream_guard_alignment preserved", "- aiguard_raw_context: producer_lineage_guard_alignment preserved", "- aiguard_raw_context: missing_telemetry_orchestrator_context preserved", + "- aiguard_raw_context: max_total_queue_depth traceability preserved", "- aiguard_handoff_alignment: external required evidence types satisfied", "- expected_report_markers: Runtime Intelligence report markers declared", "- expected_report_markers: remote fallback Lab context row declared", @@ -511,6 +517,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_contract_marker "Orchestrator queue/deadline/fallback markers", "queue_pressure_reason=queue_backlog_threshold_exceeded", "max_total_queue_depth=7", + "AIGuard max queue raw-context traceability", + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7", "AIGuard producer-lineage guard alignment", "edgeenv_orchestrator_producer_lineage", "AIGuard run_config traceability evidence", @@ -599,6 +607,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_missing_coverage_gap_ma "Orchestrator queue/deadline/fallback markers", "queue_pressure_reason=queue_backlog_threshold_exceeded", "max_total_queue_depth=7", + "AIGuard max queue raw-context traceability", + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7", "AIGuard producer-lineage guard alignment", "edgeenv_orchestrator_producer_lineage", "AIGuard run_config traceability evidence", @@ -672,6 +682,8 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_failed_deployment_risk( "Orchestrator queue/deadline/fallback markers", "queue_pressure_reason=queue_backlog_threshold_exceeded", "max_total_queue_depth=7", + "AIGuard max queue raw-context traceability", + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7", "AIGuard producer-lineage guard alignment", "edgeenv_orchestrator_producer_lineage", "AIGuard run_config traceability evidence", @@ -722,6 +734,7 @@ def test_runtime_intelligence_ci_artifact_gate_fails_for_failed_deployment_risk( "- aiguard_raw_context: downstream_guard_alignment preserved", "- aiguard_raw_context: producer_lineage_guard_alignment preserved", "- aiguard_raw_context: missing_telemetry_orchestrator_context preserved", + "- aiguard_raw_context: max_total_queue_depth traceability preserved", "- aiguard_handoff_alignment: external required evidence types satisfied", "- expected_report_markers: Runtime Intelligence report markers declared", "- expected_report_markers: remote fallback Lab context row declared", diff --git a/tests/test_runtime_intelligence_evidence_chain_smoke.py b/tests/test_runtime_intelligence_evidence_chain_smoke.py index 77766aa..e252f3f 100644 --- a/tests/test_runtime_intelligence_evidence_chain_smoke.py +++ b/tests/test_runtime_intelligence_evidence_chain_smoke.py @@ -424,6 +424,12 @@ def test_runtime_intelligence_chain_smoke_ingests_precomputed_guard_artifact(): "sources=device_local_cli_override, stages=vision_agent:device_local_starter, " "device_local_events=2.0, role=supplemental |" ) in bundle["markdown"] + assert ( + "| AIGuard max queue raw-context traceability | candidate: " + "report=max_total_queue_depth=7, " + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7, " + "match=True |" + ) in bundle["markdown"] assert ( "| AIGuard producer-lineage guard alignment | " "evidence=edgeenv_orchestrator_producer_lineage, " @@ -530,6 +536,12 @@ def test_compare_cmd_runtime_intelligence_chain_writes_markdown_and_html( ) in markdown assert "queue=queue_backlog_threshold_exceeded" in markdown assert "AIGuard producer lineage handoff" in markdown + assert "AIGuard max queue raw-context traceability" in markdown + assert ( + "report=max_total_queue_depth=7, " + "raw_context=orchestrator_candidate_operation_max_total_queue_depth=7, " + "match=True" + ) in markdown assert "AIGuard producer-lineage guard alignment" in markdown assert "edgeenv_orchestrator_producer_lineage" in markdown assert "Device-local Orchestrator producer lineage is preserved" in markdown @@ -568,6 +580,8 @@ def test_compare_cmd_runtime_intelligence_chain_writes_markdown_and_html( ) in html assert "queue=queue_backlog_threshold_exceeded" in html assert "AIGuard producer lineage handoff" in html + assert "AIGuard max queue raw-context traceability" in html + assert "orchestrator_candidate_operation_max_total_queue_depth=7" in html assert "AIGuard producer-lineage guard alignment" in html assert "edgeenv_orchestrator_producer_lineage" in html assert "Device-local Orchestrator producer lineage is preserved" in html