fix(awooop): derive work progress from automation receipts
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 18s
CD Pipeline / build-and-deploy (push) Successful in 3m45s
CD Pipeline / post-deploy-checks (push) Successful in 1m13s

This commit is contained in:
Your Name
2026-06-29 18:24:38 +08:00
parent 68cbea8a23
commit 5722775152
2 changed files with 211 additions and 11 deletions

View File

@@ -882,9 +882,21 @@ def _build_learning_loop_readback(
and controlled_retry_package.get("schema_version")
== "ai_agent_controlled_retry_package_v1"
)
learned_context_ready = bool(
verifier_total > 0
and km_total > 0
and learning_writeback_total > 0
and trust_total > 0
and learning_source_family_count > 0
and repair_feedback_ready
)
next_decision_ready = bool(
agent_decision_wiring.get("status") == "completed"
and loop_ledger.get("closed") is True
and (
loop_ledger.get("closed") is True
or latest_flow_closure.get("closed") is True
or learned_context_ready
)
)
stages = [
_learning_loop_stage(
@@ -1546,8 +1558,8 @@ def _build_work_item_progress(
decision_wiring_missing = _int_value(decision_rollups.get("required_stage_missing_count"))
p1a_completed = inactive_source_count == 0
p1b_completed = (
p1a_completed
and agent_decision_wiring.get("schema_version") == "ai_agent_decision_wiring_readback_v1"
agent_decision_wiring.get("schema_version") == "ai_agent_decision_wiring_readback_v1"
and agent_decision_wiring.get("status") == "completed"
and decision_wiring_missing == 0
)
learning_rollups = learning_loop.get("rollups")
@@ -1555,8 +1567,8 @@ def _build_work_item_progress(
learning_rollups = {}
learning_loop_missing = _int_value(learning_rollups.get("required_stage_missing_count"))
p1c_completed = (
p1b_completed
and learning_loop.get("schema_version") == "ai_agent_learning_loop_readback_v1"
learning_loop.get("schema_version") == "ai_agent_learning_loop_readback_v1"
and learning_loop.get("status") == "completed"
and learning_loop_missing == 0
)
alert_noise_rollups = alert_noise_reduction.get("rollups")
@@ -1564,9 +1576,9 @@ def _build_work_item_progress(
alert_noise_rollups = {}
alert_noise_missing = _int_value(alert_noise_rollups.get("required_stage_missing_count"))
p1d_completed = (
p1c_completed
and alert_noise_reduction.get("schema_version")
alert_noise_reduction.get("schema_version")
== "ai_agent_alert_noise_reduction_readback_v1"
and alert_noise_reduction.get("status") == "completed"
and alert_noise_missing == 0
)
ui_rollups = ui_productization.get("rollups")
@@ -1574,9 +1586,9 @@ def _build_work_item_progress(
ui_rollups = {}
ui_surface_missing = _int_value(ui_rollups.get("required_surface_missing_count"))
p2a_completed = (
p1d_completed
and ui_productization.get("schema_version")
ui_productization.get("schema_version")
== "ai_agent_ui_productization_readback_v1"
and ui_productization.get("status") == "completed"
and ui_surface_missing == 0
)
multi_product_rollups = multi_product_taxonomy.get("rollups")
@@ -1588,9 +1600,9 @@ def _build_work_item_progress(
else []
) + _int_value(multi_product_rollups.get("missing_required_dimension_count"))
p2b_completed = (
p2a_completed
and multi_product_taxonomy.get("schema_version")
multi_product_taxonomy.get("schema_version")
== "ai_agent_multi_product_taxonomy_contract_v1"
and multi_product_taxonomy.get("status") == "completed"
and multi_product_missing == 0
)
deployed_readback_complete = (