loopx 0.4.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- loopx/__init__.py +5 -0
- loopx/agent_onboarding.py +654 -0
- loopx/agent_registry.py +112 -0
- loopx/ark_managed_agent_host.py +59 -0
- loopx/authority.py +805 -0
- loopx/benchmark.py +2875 -0
- loopx/benchmark_adapters/__init__.py +1 -0
- loopx/benchmark_adapters/agentissue.py +2644 -0
- loopx/benchmark_adapters/agents_last_exam.py +3998 -0
- loopx/benchmark_adapters/edgebench.py +322 -0
- loopx/benchmark_adapters/skillsbench.py +5978 -0
- loopx/benchmark_adapters/skillsbench_acp_failure_policy.py +143 -0
- loopx/benchmark_adapters/skillsbench_acp_process.py +31 -0
- loopx/benchmark_adapters/skillsbench_acp_relay.py +4832 -0
- loopx/benchmark_adapters/skillsbench_batch.py +124 -0
- loopx/benchmark_adapters/skillsbench_bridge_guard.py +209 -0
- loopx/benchmark_adapters/skillsbench_bridge_summary.py +203 -0
- loopx/benchmark_adapters/skillsbench_codex_goal_recovery.py +271 -0
- loopx/benchmark_adapters/skillsbench_codex_goal_trace.py +81 -0
- loopx/benchmark_adapters/skillsbench_codex_runtime.py +339 -0
- loopx/benchmark_adapters/skillsbench_dockerfile_runtime.py +467 -0
- loopx/benchmark_adapters/skillsbench_failure_signals.py +652 -0
- loopx/benchmark_adapters/skillsbench_proxy_runtime.py +327 -0
- loopx/benchmark_adapters/skillsbench_remote_bridge.py +402 -0
- loopx/benchmark_adapters/skillsbench_result_discovery.py +143 -0
- loopx/benchmark_adapters/skillsbench_runner_profile.py +436 -0
- loopx/benchmark_adapters/skillsbench_runner_source.py +99 -0
- loopx/benchmark_adapters/skillsbench_setup_preflight.py +771 -0
- loopx/benchmark_adapters/skillsbench_signals.py +15 -0
- loopx/benchmark_adapters/skillsbench_task_source.py +141 -0
- loopx/benchmark_adapters/skillsbench_turn_route.py +723 -0
- loopx/benchmark_adapters/skillsbench_turn_runtime.py +1069 -0
- loopx/benchmark_adapters/skillsbench_typed_repair.py +689 -0
- loopx/benchmark_adapters/skillsbench_uv_cache.py +111 -0
- loopx/benchmark_adapters/skillsbench_verifier_bootstrap.py +227 -0
- loopx/benchmark_adapters/skillsbench_verifier_cache.py +138 -0
- loopx/benchmark_adapters/terminal_bench.py +10078 -0
- loopx/benchmark_case_analysis.py +1276 -0
- loopx/benchmark_case_state.py +1079 -0
- loopx/benchmark_core/__init__.py +239 -0
- loopx/benchmark_core/adapter.py +84 -0
- loopx/benchmark_core/artifacts.py +517 -0
- loopx/benchmark_core/attempts.py +199 -0
- loopx/benchmark_core/container_exec.py +216 -0
- loopx/benchmark_core/io.py +68 -0
- loopx/benchmark_core/lifecycle.py +211 -0
- loopx/benchmark_core/loop_protocol.py +689 -0
- loopx/benchmark_core/observable_handles.py +348 -0
- loopx/benchmark_core/parity.py +256 -0
- loopx/benchmark_core/remote_closeout.py +482 -0
- loopx/benchmark_core/rounds.py +215 -0
- loopx/benchmark_core/route_profile.py +509 -0
- loopx/benchmark_core/run_permissions.py +206 -0
- loopx/benchmark_core/split_control.py +925 -0
- loopx/benchmark_core/turn_fidelity.py +326 -0
- loopx/benchmark_ledger.py +3793 -0
- loopx/benchmark_ledger_countability.py +372 -0
- loopx/benchmark_ledger_current.py +724 -0
- loopx/benchmark_trajectory.py +405 -0
- loopx/benchmarks/__init__.py +1 -0
- loopx/benchmarks/qualification/__init__.py +1 -0
- loopx/benchmarks/qualification/release_outcome_baseline.py +360 -0
- loopx/benchmarks/read_models/__init__.py +1 -0
- loopx/benchmarks/read_models/benchmark_attempt_accounting.py +53 -0
- loopx/benchmarks/read_models/benchmark_comparison.py +414 -0
- loopx/benchmarks/read_models/benchmark_event_timeline.py +113 -0
- loopx/benchmarks/read_models/benchmark_experiment_report.py +475 -0
- loopx/benchmarks/read_models/benchmark_learning_ledger.py +137 -0
- loopx/benchmarks/read_models/benchmark_lifecycle_contracts.py +228 -0
- loopx/benchmarks/read_models/benchmark_projection.py +723 -0
- loopx/benchmarks/read_models/benchmark_result.py +146 -0
- loopx/benchmarks/read_models/benchmark_run_execution_contract.py +116 -0
- loopx/benchmarks/read_models/benchmark_run_failure.py +157 -0
- loopx/benchmarks/read_models/benchmark_run_metrics.py +213 -0
- loopx/benchmarks/read_models/benchmark_run_post_execution.py +635 -0
- loopx/benchmarks/read_models/benchmark_run_pre_execution.py +541 -0
- loopx/benchmarks/read_models/benchmark_status_compaction.py +1255 -0
- loopx/benchmarks/read_models/benchmark_status_runner.py +780 -0
- loopx/benchmarks/read_models/goal_start_control_score.py +857 -0
- loopx/benchmarks/read_models/skillsbench_post_run_debug.py +746 -0
- loopx/benchmarks/read_models/skillsbench_verifier_attribution.py +269 -0
- loopx/bootstrap.py +1116 -0
- loopx/bootstrap_command_pack.py +2167 -0
- loopx/boundary_authority.py +199 -0
- loopx/canary/__init__.py +1 -0
- loopx/canary/maintainability_ratchet.py +800 -0
- loopx/canary/planner.py +1984 -0
- loopx/canary/premerge.py +1130 -0
- loopx/canary/qualification_profiles.py +309 -0
- loopx/canary/quality_surface_catalog.py +838 -0
- loopx/canary/release_profiles.py +51 -0
- loopx/canary/runner.py +1107 -0
- loopx/canary/smoke_health.py +581 -0
- loopx/canary/smoke_profiles.py +212 -0
- loopx/capabilities/__init__.py +0 -0
- loopx/capabilities/agent_turn_recall/__init__.py +17 -0
- loopx/capabilities/agent_turn_recall/cli.py +369 -0
- loopx/capabilities/agent_turn_recall/core.py +296 -0
- loopx/capabilities/auto_research/__init__.py +16 -0
- loopx/capabilities/auto_research/bootstrap_contract.py +157 -0
- loopx/capabilities/auto_research/cli.py +1468 -0
- loopx/capabilities/auto_research/core.py +11 -0
- loopx/capabilities/auto_research/defaults.py +79 -0
- loopx/capabilities/auto_research/demo_e2e.py +1848 -0
- loopx/capabilities/auto_research/demo_supervisor.py +186 -0
- loopx/capabilities/auto_research/evidence_packet.py +767 -0
- loopx/capabilities/auto_research/human_view.py +794 -0
- loopx/capabilities/auto_research/kernel.py +191 -0
- loopx/capabilities/auto_research/knn_demo_workspace.py +322 -0
- loopx/capabilities/auto_research/live_evidence.py +248 -0
- loopx/capabilities/auto_research/preset.py +176 -0
- loopx/capabilities/auto_research/research_state.py +1085 -0
- loopx/capabilities/auto_research/role_profiles.py +394 -0
- loopx/capabilities/auto_research/rollout_append.py +97 -0
- loopx/capabilities/auto_research/terminal_result_contract.py +422 -0
- loopx/capabilities/auto_research/terminal_result_projection.py +171 -0
- loopx/capabilities/auto_research/terminal_result_query.py +233 -0
- loopx/capabilities/auto_research/terminal_results.py +349 -0
- loopx/capabilities/auto_research/user_contract.py +190 -0
- loopx/capabilities/auto_research/worker_loop.py +163 -0
- loopx/capabilities/auto_research/worker_runtime.py +777 -0
- loopx/capabilities/auto_research/worker_skill/SKILL.md +343 -0
- loopx/capabilities/benchmark_toolkit/__init__.py +19 -0
- loopx/capabilities/benchmark_toolkit/integrity.py +387 -0
- loopx/capabilities/catalog.py +1875 -0
- loopx/capabilities/change_quality/__init__.py +19 -0
- loopx/capabilities/change_quality/cli.py +171 -0
- loopx/capabilities/change_quality/context.py +156 -0
- loopx/capabilities/change_quality/oracles.py +269 -0
- loopx/capabilities/change_quality/policy.py +34 -0
- loopx/capabilities/change_quality/receipt.py +482 -0
- loopx/capabilities/change_quality/result.py +493 -0
- loopx/capabilities/change_quality/scope.py +171 -0
- loopx/capabilities/change_quality/shadow.py +680 -0
- loopx/capabilities/content_ops/__init__.py +0 -0
- loopx/capabilities/content_ops/cli.py +649 -0
- loopx/capabilities/content_ops/connector_packets.py +164 -0
- loopx/capabilities/content_ops/item_lifecycle.py +1000 -0
- loopx/capabilities/content_ops/layout.py +451 -0
- loopx/capabilities/content_ops/markdown.py +456 -0
- loopx/capabilities/content_ops/schemas.py +51 -0
- loopx/capabilities/content_ops/social_browser_x.py +107 -0
- loopx/capabilities/content_ops/surface.py +1956 -0
- loopx/capabilities/content_ops/templates/layout-catalog-v0.json +72 -0
- loopx/capabilities/context_providers/__init__.py +36 -0
- loopx/capabilities/context_providers/base.py +189 -0
- loopx/capabilities/context_providers/factory.py +32 -0
- loopx/capabilities/context_providers/openviking.py +702 -0
- loopx/capabilities/context_providers/service_ownership.py +185 -0
- loopx/capabilities/decision_context/__init__.py +129 -0
- loopx/capabilities/decision_context/architecture.py +83 -0
- loopx/capabilities/decision_context/assembler.py +849 -0
- loopx/capabilities/decision_context/catalog_entry.py +195 -0
- loopx/capabilities/decision_context/cli.py +310 -0
- loopx/capabilities/decision_context/cursor_commit.py +535 -0
- loopx/capabilities/decision_context/outcome_feedback.py +352 -0
- loopx/capabilities/decision_context/packets.py +654 -0
- loopx/capabilities/decision_context/private_state.py +189 -0
- loopx/capabilities/decision_context/profile.py +453 -0
- loopx/capabilities/decision_context/providers.py +228 -0
- loopx/capabilities/decision_context/review_settlement.py +136 -0
- loopx/capabilities/decision_context/runtime.py +273 -0
- loopx/capabilities/decision_context/sources.py +415 -0
- loopx/capabilities/explore/__init__.py +1 -0
- loopx/capabilities/explore/activation.py +198 -0
- loopx/capabilities/explore/adaptive_replay_planner.py +221 -0
- loopx/capabilities/explore/child_replay_runtime.py +463 -0
- loopx/capabilities/explore/composition_frontier.py +291 -0
- loopx/capabilities/explore/counterfactual_runtime.py +578 -0
- loopx/capabilities/explore/episode_runtime.py +647 -0
- loopx/capabilities/explore/harness_checkpoint.py +171 -0
- loopx/capabilities/explore/harness_gate.py +115 -0
- loopx/capabilities/explore/harness_runtime.py +1124 -0
- loopx/capabilities/explore/replay_metrics.py +206 -0
- loopx/capabilities/explore/replay_runtime.py +1271 -0
- loopx/capabilities/explore/resource_portfolio.py +173 -0
- loopx/capabilities/explore/result_log.py +974 -0
- loopx/capabilities/explore/router_state.py +432 -0
- loopx/capabilities/explore/source_history_reconcile.py +255 -0
- loopx/capabilities/explore/speculative_scheduler.py +498 -0
- loopx/capabilities/explore/todo_branch_plan.py +650 -0
- loopx/capabilities/explore/todo_evidence.py +141 -0
- loopx/capabilities/explore/trace_runtime.py +284 -0
- loopx/capabilities/explore/worker_branch_plan.py +1257 -0
- loopx/capabilities/integration_branch/__init__.py +13 -0
- loopx/capabilities/integration_branch/cli.py +148 -0
- loopx/capabilities/integration_branch/core.py +916 -0
- loopx/capabilities/issue_fix/__init__.py +19 -0
- loopx/capabilities/issue_fix/acceptance_loop.py +1050 -0
- loopx/capabilities/issue_fix/candidate_evidence.py +503 -0
- loopx/capabilities/issue_fix/candidate_preflight.py +676 -0
- loopx/capabilities/issue_fix/cli.py +1822 -0
- loopx/capabilities/issue_fix/cli_input.py +87 -0
- loopx/capabilities/issue_fix/content_ops_cli.py +148 -0
- loopx/capabilities/issue_fix/discovered_issue_promotion.py +947 -0
- loopx/capabilities/issue_fix/explore_projection.py +710 -0
- loopx/capabilities/issue_fix/feasibility.py +542 -0
- loopx/capabilities/issue_fix/github_public.py +661 -0
- loopx/capabilities/issue_fix/intake_surface.py +832 -0
- loopx/capabilities/issue_fix/metadata_preview.py +218 -0
- loopx/capabilities/issue_fix/metrics_projection.py +1340 -0
- loopx/capabilities/issue_fix/metrics_supplement.py +634 -0
- loopx/capabilities/issue_fix/metrics_supplement_cli.py +127 -0
- loopx/capabilities/issue_fix/outcome_projection.py +1235 -0
- loopx/capabilities/issue_fix/periodic_report.py +189 -0
- loopx/capabilities/issue_fix/pr_description.py +418 -0
- loopx/capabilities/issue_fix/pr_gate_reconcile.py +496 -0
- loopx/capabilities/issue_fix/pr_gate_reconcile_cli.py +464 -0
- loopx/capabilities/issue_fix/pr_lifecycle.py +1327 -0
- loopx/capabilities/issue_fix/pr_lifecycle_rollout.py +85 -0
- loopx/capabilities/issue_fix/pr_monitor_materialization.py +257 -0
- loopx/capabilities/issue_fix/pr_review_ack.py +439 -0
- loopx/capabilities/issue_fix/provider_hooks.py +24 -0
- loopx/capabilities/issue_fix/repository_commit_evidence.py +186 -0
- loopx/capabilities/issue_fix/repository_context.py +457 -0
- loopx/capabilities/issue_fix/repository_memory.py +459 -0
- loopx/capabilities/issue_fix/repository_memory_provider.py +1454 -0
- loopx/capabilities/issue_fix/repository_snapshot.py +454 -0
- loopx/capabilities/issue_fix/reviewer_cli.py +917 -0
- loopx/capabilities/issue_fix/reviewer_notification.py +882 -0
- loopx/capabilities/issue_fix/reviewer_notification_drain.py +942 -0
- loopx/capabilities/issue_fix/reviewer_recommendation.py +1057 -0
- loopx/capabilities/issue_fix/reviewer_request.py +1282 -0
- loopx/capabilities/issue_fix/reward_memory.py +879 -0
- loopx/capabilities/issue_fix/workflow_plan.py +1286 -0
- loopx/capabilities/material_lifecycle/__init__.py +161 -0
- loopx/capabilities/material_lifecycle/_validation.py +183 -0
- loopx/capabilities/material_lifecycle/apply.py +672 -0
- loopx/capabilities/material_lifecycle/architecture.py +122 -0
- loopx/capabilities/material_lifecycle/cli.py +161 -0
- loopx/capabilities/material_lifecycle/decision_planning.py +470 -0
- loopx/capabilities/material_lifecycle/explore_execution.py +306 -0
- loopx/capabilities/material_lifecycle/intake.py +869 -0
- loopx/capabilities/material_lifecycle/inventory.py +147 -0
- loopx/capabilities/material_lifecycle/lifecycle.py +98 -0
- loopx/capabilities/material_lifecycle/preparation.py +147 -0
- loopx/capabilities/material_lifecycle/project_skill.py +83 -0
- loopx/capabilities/material_lifecycle/ranking.py +267 -0
- loopx/capabilities/material_lifecycle/readable_projection.py +500 -0
- loopx/capabilities/material_lifecycle/rebuild.py +480 -0
- loopx/capabilities/material_lifecycle/settlement.py +238 -0
- loopx/capabilities/periodic_report/__init__.py +71 -0
- loopx/capabilities/periodic_report/adapters.py +939 -0
- loopx/capabilities/periodic_report/archive.py +422 -0
- loopx/capabilities/periodic_report/bindings.py +705 -0
- loopx/capabilities/periodic_report/cli.py +277 -0
- loopx/capabilities/periodic_report/core.py +691 -0
- loopx/capabilities/periodic_report/extension_envelope.py +66 -0
- loopx/capabilities/periodic_report/presets.py +103 -0
- loopx/capabilities/periodic_report/profile.py +235 -0
- loopx/capabilities/periodic_report/project_progress.py +179 -0
- loopx/capabilities/periodic_report/triggers.py +452 -0
- loopx/capabilities/pr_review_queue/__init__.py +17 -0
- loopx/capabilities/pr_review_queue/core.py +506 -0
- loopx/capabilities/pr_review_queue/review_contract.py +506 -0
- loopx/capabilities/registry.py +192 -0
- loopx/capabilities/reward_memory/__init__.py +75 -0
- loopx/capabilities/reward_memory/application.py +819 -0
- loopx/capabilities/reward_memory/architecture.py +572 -0
- loopx/capabilities/reward_memory/candidate_review.py +511 -0
- loopx/capabilities/reward_memory/cli.py +469 -0
- loopx/capabilities/reward_memory/dogfood.py +574 -0
- loopx/capabilities/reward_memory/evaluation.py +296 -0
- loopx/capabilities/reward_memory/evaluation_fixtures.py +362 -0
- loopx/capabilities/reward_memory/experiment.py +567 -0
- loopx/capabilities/reward_memory/health.py +222 -0
- loopx/capabilities/reward_memory/ingestion.py +519 -0
- loopx/capabilities/reward_memory/registry.py +600 -0
- loopx/capabilities/reward_memory/runtime_hooks.py +312 -0
- loopx/capabilities/reward_memory/scoped_feedback.py +173 -0
- loopx/capabilities/semantic_preference/__init__.py +12 -0
- loopx/capabilities/semantic_preference/cli.py +189 -0
- loopx/capabilities/semantic_preference/contract.py +592 -0
- loopx/capabilities/semantic_preference/reward_memory.py +62 -0
- loopx/capabilities/value_connectors/__init__.py +1 -0
- loopx/capabilities/value_connectors/cli.py +401 -0
- loopx/capabilities/value_connectors/finance_extension_migration.py +108 -0
- loopx/capabilities/value_connectors/install_check.py +147 -0
- loopx/capabilities/value_connectors/planner.py +733 -0
- loopx/capabilities/value_connectors/source_map.py +446 -0
- loopx/claude_goal_baseline.py +138 -0
- loopx/claude_goal_mode/__init__.py +23 -0
- loopx/claude_goal_mode/hooks/goal_policy.py +212 -0
- loopx/claude_goal_mode/hooks/goal_state.py +139 -0
- loopx/claude_goal_mode/mcp/loopx_mcp.py +167 -0
- loopx/claude_goal_mode/scripts/connect.py +103 -0
- loopx/claude_goal_mode/scripts/goalmode_cmd.py +241 -0
- loopx/claude_goal_mode/scripts/install.py +328 -0
- loopx/claude_goal_mode/statusline/goal_status.py +97 -0
- loopx/cli.py +836 -0
- loopx/cli_commands/__init__.py +334 -0
- loopx/cli_commands/_host_thread.py +13 -0
- loopx/cli_commands/agentissue_runner_flow.py +447 -0
- loopx/cli_commands/agents_last_exam.py +160 -0
- loopx/cli_commands/agents_last_exam_baked_input.py +302 -0
- loopx/cli_commands/agents_last_exam_host_codex.py +374 -0
- loopx/cli_commands/agents_last_exam_launch_dry_run.py +372 -0
- loopx/cli_commands/agents_last_exam_local_plan.py +322 -0
- loopx/cli_commands/agents_last_exam_runner_source.py +352 -0
- loopx/cli_commands/agents_last_exam_task_material.py +335 -0
- loopx/cli_commands/agents_last_exam_validation_gate.py +236 -0
- loopx/cli_commands/benchmark_boundary.py +499 -0
- loopx/cli_commands/benchmark_dispatch.py +161 -0
- loopx/cli_commands/benchmark_release_outcome.py +123 -0
- loopx/cli_commands/benchmark_review_lifecycle.py +1275 -0
- loopx/cli_commands/benchmark_run_ledger.py +763 -0
- loopx/cli_commands/benchmark_run_ledger_case_analysis.py +249 -0
- loopx/cli_commands/benchmark_run_ledger_classification.py +45 -0
- loopx/cli_commands/benchmark_run_ledger_maintenance.py +486 -0
- loopx/cli_commands/benchmark_run_ledger_maintenance_registration.py +342 -0
- loopx/cli_commands/benchmark_run_ledger_maintenance_rendering.py +233 -0
- loopx/cli_commands/benchmark_run_ledger_parity.py +92 -0
- loopx/cli_commands/bootstrap_connect.py +238 -0
- loopx/cli_commands/canary.py +707 -0
- loopx/cli_commands/canary_release_qualification.py +79 -0
- loopx/cli_commands/capability.py +96 -0
- loopx/cli_commands/doctor.py +43 -0
- loopx/cli_commands/dreaming.py +143 -0
- loopx/cli_commands/edgebench.py +205 -0
- loopx/cli_commands/evidence_log.py +275 -0
- loopx/cli_commands/explore.py +989 -0
- loopx/cli_commands/explore_planning_commands.py +157 -0
- loopx/cli_commands/extension.py +271 -0
- loopx/cli_commands/first_run_report.py +73 -0
- loopx/cli_commands/goal_channel.py +656 -0
- loopx/cli_commands/handoff_mode.py +158 -0
- loopx/cli_commands/history.py +622 -0
- loopx/cli_commands/host_mode_plan.py +113 -0
- loopx/cli_commands/lark_inbox.py +431 -0
- loopx/cli_commands/lark_kanban.py +629 -0
- loopx/cli_commands/ml_experiment.py +321 -0
- loopx/cli_commands/multi_agent.py +211 -0
- loopx/cli_commands/opencode2_goal_worker.py +217 -0
- loopx/cli_commands/pr_review.py +167 -0
- loopx/cli_commands/presentation.py +218 -0
- loopx/cli_commands/preset.py +96 -0
- loopx/cli_commands/project.py +150 -0
- loopx/cli_commands/project_lifecycle.py +915 -0
- loopx/cli_commands/quota.py +859 -0
- loopx/cli_commands/quota_registration.py +241 -0
- loopx/cli_commands/quota_request.py +113 -0
- loopx/cli_commands/ready_score.py +110 -0
- loopx/cli_commands/registry_admin.py +975 -0
- loopx/cli_commands/registry_admin_configure.py +344 -0
- loopx/cli_commands/registry_admin_peer.py +84 -0
- loopx/cli_commands/registry_authority.py +218 -0
- loopx/cli_commands/review_batch.py +146 -0
- loopx/cli_commands/slash_commands.py +145 -0
- loopx/cli_commands/start_goal.py +251 -0
- loopx/cli_commands/starter.py +175 -0
- loopx/cli_commands/starter_bootstrap.py +179 -0
- loopx/cli_commands/starter_bootstrap_registration.py +198 -0
- loopx/cli_commands/starter_runtime_idle.py +107 -0
- loopx/cli_commands/starter_scheduler.py +207 -0
- loopx/cli_commands/starter_session_runtime.py +152 -0
- loopx/cli_commands/starter_visible_common.py +54 -0
- loopx/cli_commands/starter_visible_driver.py +161 -0
- loopx/cli_commands/starter_visible_pilot.py +278 -0
- loopx/cli_commands/status.py +867 -0
- loopx/cli_commands/status_registration.py +239 -0
- loopx/cli_commands/summary_all.py +222 -0
- loopx/cli_commands/support_control.py +809 -0
- loopx/cli_commands/support_control_registry.py +68 -0
- loopx/cli_commands/support_control_supervisor.py +289 -0
- loopx/cli_commands/task_lease.py +306 -0
- loopx/cli_commands/terminal_bench_adapter.py +717 -0
- loopx/cli_commands/terminal_bench_environment_result.py +1246 -0
- loopx/cli_commands/todo.py +940 -0
- loopx/cli_commands/todo_argument_validation.py +572 -0
- loopx/cli_commands/todo_event.py +114 -0
- loopx/cli_commands/turn.py +804 -0
- loopx/cli_commands/version.py +46 -0
- loopx/cli_commands/worker_bridge.py +659 -0
- loopx/cli_rollout.py +314 -0
- loopx/codex_cli_goal_tui.py +672 -0
- loopx/codex_cli_probe.py +1530 -0
- loopx/codex_cli_probe_markdown.py +935 -0
- loopx/codex_cli_runtime_probe.py +733 -0
- loopx/codex_cli_scheduler.py +564 -0
- loopx/codex_goal_baseline.py +620 -0
- loopx/configuration_catalog.py +617 -0
- loopx/configure_goal.py +1375 -0
- loopx/contract.py +996 -0
- loopx/control_plane/__init__.py +71 -0
- loopx/control_plane/agents/__init__.py +1 -0
- loopx/control_plane/agents/agent_lane_recommendation.py +516 -0
- loopx/control_plane/agents/agent_scope.py +1578 -0
- loopx/control_plane/agents/agent_scope_frontier.py +60 -0
- loopx/control_plane/agents/capability_gate.py +531 -0
- loopx/control_plane/agents/identity.py +140 -0
- loopx/control_plane/agents/legacy_migration.py +169 -0
- loopx/control_plane/agents/management_projection.py +658 -0
- loopx/control_plane/agents/material_frontier.py +608 -0
- loopx/control_plane/agents/material_handoff.py +156 -0
- loopx/control_plane/agents/multi_agent/__init__.py +1 -0
- loopx/control_plane/agents/multi_agent/codex_executable.py +207 -0
- loopx/control_plane/agents/multi_agent/collective_round_ledger.py +387 -0
- loopx/control_plane/agents/multi_agent/contract.py +474 -0
- loopx/control_plane/agents/multi_agent/recipe.py +110 -0
- loopx/control_plane/agents/multi_agent/role_successor.py +297 -0
- loopx/control_plane/agents/multi_agent/runtime_scripts.py +426 -0
- loopx/control_plane/agents/multi_agent/visible_launch_policy.py +149 -0
- loopx/control_plane/agents/multi_agent/visible_wake_scheduler.py +392 -0
- loopx/control_plane/agents/profile.py +216 -0
- loopx/control_plane/agents/runtime_model.py +73 -0
- loopx/control_plane/agents/subagent_activity.py +164 -0
- loopx/control_plane/agents/supervisor.py +544 -0
- loopx/control_plane/agents/supervisor_events.py +462 -0
- loopx/control_plane/agents/supervisor_inject.py +204 -0
- loopx/control_plane/agents/work_mode.py +56 -0
- loopx/control_plane/agents/workspace_guard.py +364 -0
- loopx/control_plane/effect_program.py +644 -0
- loopx/control_plane/goals/__init__.py +1 -0
- loopx/control_plane/goals/active_state_event_projection.py +103 -0
- loopx/control_plane/goals/active_state_metadata.py +47 -0
- loopx/control_plane/goals/active_state_sections.py +58 -0
- loopx/control_plane/goals/configure_goal_service.py +354 -0
- loopx/control_plane/goals/contract_health.py +132 -0
- loopx/control_plane/goals/dreaming.py +152 -0
- loopx/control_plane/goals/global_registry_health.py +199 -0
- loopx/control_plane/goals/global_registry_shadow.py +33 -0
- loopx/control_plane/goals/goal_channel.py +34 -0
- loopx/control_plane/goals/goal_channel_projection.py +560 -0
- loopx/control_plane/goals/goal_frontier/__init__.py +1917 -0
- loopx/control_plane/goals/goal_frontier/ack_policy.py +149 -0
- loopx/control_plane/goals/goal_frontier/outcome_continuity.py +437 -0
- loopx/control_plane/goals/goal_frontier/replan_rules.py +210 -0
- loopx/control_plane/goals/goal_frontier/semantic_history.py +314 -0
- loopx/control_plane/goals/goal_frontier/terminal.py +180 -0
- loopx/control_plane/goals/goal_vision.py +443 -0
- loopx/control_plane/goals/goal_vision_policy.py +36 -0
- loopx/control_plane/goals/goal_vision_state.py +62 -0
- loopx/control_plane/goals/goal_vision_wait.py +290 -0
- loopx/control_plane/goals/path_resolution.py +20 -0
- loopx/control_plane/goals/start_contract.py +206 -0
- loopx/control_plane/goals/vision_checkpoint.py +92 -0
- loopx/control_plane/handoff/__init__.py +1 -0
- loopx/control_plane/handoff/cross_runtime_impl_review.py +311 -0
- loopx/control_plane/handoff/delivery_contract.py +161 -0
- loopx/control_plane/handoff/handoff_runs.py +71 -0
- loopx/control_plane/handoff/project_handoff.py +155 -0
- loopx/control_plane/handoff/review_batch.py +463 -0
- loopx/control_plane/handoff/review_packet_context.py +216 -0
- loopx/control_plane/heartbeat/agent.py +173 -0
- loopx/control_plane/heartbeat/budget.py +66 -0
- loopx/control_plane/heartbeat/builder.py +501 -0
- loopx/control_plane/heartbeat/host.py +64 -0
- loopx/control_plane/heartbeat/rules.py +68 -0
- loopx/control_plane/heartbeat/task_body.py +759 -0
- loopx/control_plane/heartbeat/visible_goal.py +86 -0
- loopx/control_plane/projects/__init__.py +1 -0
- loopx/control_plane/projects/contract.py +25 -0
- loopx/control_plane/projects/registry.py +663 -0
- loopx/control_plane/quota/__init__.py +1 -0
- loopx/control_plane/quota/cli_projection.py +704 -0
- loopx/control_plane/quota/decision_summary.py +431 -0
- loopx/control_plane/quota/effect_program.py +152 -0
- loopx/control_plane/quota/error_codes.py +19 -0
- loopx/control_plane/quota/goal_boundary.py +464 -0
- loopx/control_plane/quota/heartbeat_receipt.py +277 -0
- loopx/control_plane/quota/heartbeat_recommendation.py +718 -0
- loopx/control_plane/quota/host_poll_receipts.py +162 -0
- loopx/control_plane/quota/live_decision.py +142 -0
- loopx/control_plane/quota/monitor_poll.py +786 -0
- loopx/control_plane/quota/policy_constants.py +40 -0
- loopx/control_plane/quota/projection_repair.py +262 -0
- loopx/control_plane/quota/recent_runs.py +210 -0
- loopx/control_plane/quota/scheduler_ack.py +490 -0
- loopx/control_plane/quota/selected_todo_projection.py +139 -0
- loopx/control_plane/quota/settlement.py +437 -0
- loopx/control_plane/quota/settlement_cli.py +246 -0
- loopx/control_plane/quota/settlement_validation.py +64 -0
- loopx/control_plane/quota/settlement_workspace_causality.py +180 -0
- loopx/control_plane/quota/should_run.py +249 -0
- loopx/control_plane/quota/should_run_packet.py +1165 -0
- loopx/control_plane/quota/should_run_prepare.py +675 -0
- loopx/control_plane/quota/slot_accounting.py +1123 -0
- loopx/control_plane/quota/spend_sources.py +11 -0
- loopx/control_plane/quota/stall_repair.py +397 -0
- loopx/control_plane/quota/states.py +29 -0
- loopx/control_plane/quota/task_orchestration.py +448 -0
- loopx/control_plane/quota/task_orchestration_admission.py +497 -0
- loopx/control_plane/quota/turn_envelope.py +889 -0
- loopx/control_plane/quota/usage_summary.py +140 -0
- loopx/control_plane/reward_memory.py +43 -0
- loopx/control_plane/runtime/__init__.py +2 -0
- loopx/control_plane/runtime/active_user_assisted_pilot.py +275 -0
- loopx/control_plane/runtime/agent_scoped_evidence_log.py +435 -0
- loopx/control_plane/runtime/decision_freshness.py +203 -0
- loopx/control_plane/runtime/event_ledger.py +197 -0
- loopx/control_plane/runtime/event_store_migration_bridge.py +196 -0
- loopx/control_plane/runtime/goal_project_route.py +70 -0
- loopx/control_plane/runtime/local_state_write_correctness.py +242 -0
- loopx/control_plane/runtime/promotion_readiness.py +152 -0
- loopx/control_plane/runtime/public_safety.py +120 -0
- loopx/control_plane/runtime/run_artifacts.py +78 -0
- loopx/control_plane/runtime/run_compaction.py +397 -0
- loopx/control_plane/runtime/run_context_retention.py +241 -0
- loopx/control_plane/runtime/run_history.py +132 -0
- loopx/control_plane/runtime/run_index_duplicates.py +205 -0
- loopx/control_plane/runtime/run_index_rebuild.py +263 -0
- loopx/control_plane/runtime/run_ingest_health.py +336 -0
- loopx/control_plane/runtime/runtime_projection_route.py +624 -0
- loopx/control_plane/runtime/runtime_projection_writer.py +98 -0
- loopx/control_plane/runtime/session_runtime.py +339 -0
- loopx/control_plane/runtime/shared_runtime_material_projection.py +332 -0
- loopx/control_plane/runtime/shared_runtime_refresh_projection.py +183 -0
- loopx/control_plane/runtime/stale_latest_run.py +90 -0
- loopx/control_plane/runtime/status_classifications.py +49 -0
- loopx/control_plane/runtime/status_projection_cache.py +235 -0
- loopx/control_plane/runtime/stride_observation.py +144 -0
- loopx/control_plane/runtime/time.py +39 -0
- loopx/control_plane/runtime/trajectory_hygiene.py +149 -0
- loopx/control_plane/runtime/validation_command.py +69 -0
- loopx/control_plane/scheduler/__init__.py +1 -0
- loopx/control_plane/scheduler/ack.py +329 -0
- loopx/control_plane/scheduler/arbitration.py +188 -0
- loopx/control_plane/scheduler/automation_liveness.py +183 -0
- loopx/control_plane/scheduler/execution_context.py +555 -0
- loopx/control_plane/scheduler/external_evidence_observation.py +428 -0
- loopx/control_plane/scheduler/monitor_display.py +143 -0
- loopx/control_plane/scheduler/monitor_poll_policy.py +161 -0
- loopx/control_plane/scheduler/monitor_poll_writeback.py +351 -0
- loopx/control_plane/scheduler/monitor_target.py +64 -0
- loopx/control_plane/scheduler/monitor_todo.py +146 -0
- loopx/control_plane/scheduler/monitor_wait.py +237 -0
- loopx/control_plane/scheduler/scheduler_hint.py +1284 -0
- loopx/control_plane/scheduler/state.py +354 -0
- loopx/control_plane/scheduler/state_transition_rules.py +179 -0
- loopx/control_plane/scheduler/time.py +10 -0
- loopx/control_plane/settlement_driver.py +293 -0
- loopx/control_plane/status/__init__.py +6 -0
- loopx/control_plane/status/active_state_projection.py +105 -0
- loopx/control_plane/status/agent_lane_projection.py +375 -0
- loopx/control_plane/status/attention_projection.py +74 -0
- loopx/control_plane/status/autonomous_replan_projection.py +103 -0
- loopx/control_plane/status/collection.py +140 -0
- loopx/control_plane/status/contract_projection.py +31 -0
- loopx/control_plane/status/dreaming_projection.py +52 -0
- loopx/control_plane/status/goal_attention_projection.py +157 -0
- loopx/control_plane/status/lifecycle_projection.py +110 -0
- loopx/control_plane/status/monitor_display_projection.py +69 -0
- loopx/control_plane/status/registry_health_projection.py +75 -0
- loopx/control_plane/status/run_projection.py +70 -0
- loopx/control_plane/status/runtime_summaries.py +161 -0
- loopx/control_plane/testing/__init__.py +1 -0
- loopx/control_plane/testing/actual_default_model_behavior_portfolio.py +1371 -0
- loopx/control_plane/testing/canary_harness.py +182 -0
- loopx/control_plane/testing/capability_monitor_repair_tool_behavior.py +674 -0
- loopx/control_plane/testing/cli_output_budget.py +807 -0
- loopx/control_plane/testing/cli_output_differential.py +250 -0
- loopx/control_plane/testing/cli_output_semantics.py +87 -0
- loopx/control_plane/testing/control_plane_composition_scenarios.py +225 -0
- loopx/control_plane/testing/decision_replay.py +268 -0
- loopx/control_plane/testing/doubao_model_behavior_actor.py +559 -0
- loopx/control_plane/testing/model_behavior_corpus.py +344 -0
- loopx/control_plane/testing/model_behavior_qualification.py +769 -0
- loopx/control_plane/testing/model_behavior_retained_cases.py +235 -0
- loopx/control_plane/testing/model_tool_behavior.py +536 -0
- loopx/control_plane/testing/onboarding_model_behavior_qualification.py +642 -0
- loopx/control_plane/testing/quota_fixtures.py +208 -0
- loopx/control_plane/testing/quota_should_run_parity.py +57 -0
- loopx/control_plane/testing/release_commit_qualification.py +671 -0
- loopx/control_plane/testing/replan_semantic_action_behavior.py +1302 -0
- loopx/control_plane/testing/scoped_gate_successor_tool_behavior.py +527 -0
- loopx/control_plane/testing/selected_todo_tool_behavior.py +1002 -0
- loopx/control_plane/testing/terminal_settlement_tool_behavior.py +656 -0
- loopx/control_plane/todos/__init__.py +1 -0
- loopx/control_plane/todos/active_state_editing.py +296 -0
- loopx/control_plane/todos/active_state_todo_parser.py +138 -0
- loopx/control_plane/todos/active_state_todos.py +175 -0
- loopx/control_plane/todos/addition.py +103 -0
- loopx/control_plane/todos/claim_visibility.py +253 -0
- loopx/control_plane/todos/completed_archive.py +139 -0
- loopx/control_plane/todos/completion_fence.py +49 -0
- loopx/control_plane/todos/completion_policy.py +153 -0
- loopx/control_plane/todos/completion_validation.py +248 -0
- loopx/control_plane/todos/completion_validation_accountability.py +27 -0
- loopx/control_plane/todos/completion_validation_projection.py +57 -0
- loopx/control_plane/todos/contract.py +1476 -0
- loopx/control_plane/todos/decision_scope.py +554 -0
- loopx/control_plane/todos/deferred_resume.py +546 -0
- loopx/control_plane/todos/durable_completion.py +201 -0
- loopx/control_plane/todos/event_writeback.py +484 -0
- loopx/control_plane/todos/frontier_deadline.py +132 -0
- loopx/control_plane/todos/handoff_gate.py +283 -0
- loopx/control_plane/todos/handoff_mode.py +444 -0
- loopx/control_plane/todos/handoff_note.py +202 -0
- loopx/control_plane/todos/line_update.py +361 -0
- loopx/control_plane/todos/list_projection.py +205 -0
- loopx/control_plane/todos/markdown.py +199 -0
- loopx/control_plane/todos/monitor_metadata.py +88 -0
- loopx/control_plane/todos/mutation_authority.py +299 -0
- loopx/control_plane/todos/projection.py +655 -0
- loopx/control_plane/todos/quota_summary.py +1138 -0
- loopx/control_plane/todos/route_continuation.py +267 -0
- loopx/control_plane/todos/succession_warning.py +174 -0
- loopx/control_plane/todos/summary_item.py +223 -0
- loopx/control_plane/todos/text.py +30 -0
- loopx/control_plane/todos/todo_index.py +226 -0
- loopx/control_plane/todos/todo_summary.py +1458 -0
- loopx/control_plane/todos/unblock_resume.py +326 -0
- loopx/control_plane/todos/user_gate.py +263 -0
- loopx/control_plane/todos/write_hint.py +63 -0
- loopx/control_plane/todos/write_policy.py +135 -0
- loopx/control_plane/turn_driver/__init__.py +85 -0
- loopx/control_plane/turn_driver/codex_cli.py +502 -0
- loopx/control_plane/turn_driver/driver.py +355 -0
- loopx/control_plane/turn_driver/executor.py +1468 -0
- loopx/control_plane/turn_driver/loop_controller.py +669 -0
- loopx/control_plane/turn_driver/settlement.py +318 -0
- loopx/control_plane/turn_driver/transaction.py +375 -0
- loopx/control_plane/work_items/__init__.py +1 -0
- loopx/control_plane/work_items/attention_fields.py +56 -0
- loopx/control_plane/work_items/attention_item.py +77 -0
- loopx/control_plane/work_items/attention_queue.py +322 -0
- loopx/control_plane/work_items/attention_routing.py +213 -0
- loopx/control_plane/work_items/autonomous_candidates.py +135 -0
- loopx/control_plane/work_items/autonomous_replan_ack.py +276 -0
- loopx/control_plane/work_items/autonomous_replan_obligation.py +786 -0
- loopx/control_plane/work_items/backlog_hygiene.py +59 -0
- loopx/control_plane/work_items/capability_monitor_fallback.py +221 -0
- loopx/control_plane/work_items/delivery_batch_scale.py +66 -0
- loopx/control_plane/work_items/delivery_outcome.py +152 -0
- loopx/control_plane/work_items/delivery_signals.py +113 -0
- loopx/control_plane/work_items/execution_obligation.py +235 -0
- loopx/control_plane/work_items/goal_route_hint.py +320 -0
- loopx/control_plane/work_items/interaction_contract.py +1540 -0
- loopx/control_plane/work_items/issue_meta_surface.py +159 -0
- loopx/control_plane/work_items/lifecycle.py +139 -0
- loopx/control_plane/work_items/operator_inbox.py +266 -0
- loopx/control_plane/work_items/outcome_followthrough.py +69 -0
- loopx/control_plane/work_items/primary_action.py +326 -0
- loopx/control_plane/work_items/progress_observation.py +630 -0
- loopx/control_plane/work_items/project_asset.py +675 -0
- loopx/control_plane/work_items/repair_delta.py +693 -0
- loopx/control_plane/work_items/runtime_capability_reentry.py +168 -0
- loopx/control_plane/work_items/semantic_replan_writeback.py +177 -0
- loopx/control_plane/work_items/status_contract.py +49 -0
- loopx/control_plane/work_items/task_graph.py +1046 -0
- loopx/control_plane/work_items/task_lease.py +1254 -0
- loopx/control_plane/work_items/task_lease_settlement.py +422 -0
- loopx/control_plane/work_items/work_lane.py +510 -0
- loopx/control_plane/work_items/work_lane_context.py +161 -0
- loopx/demo.py +247 -0
- loopx/diagnose.py +633 -0
- loopx/doctor.py +1251 -0
- loopx/domain_packs/__init__.py +1 -0
- loopx/domain_packs/issue_fix.py +571 -0
- loopx/domain_packs/ml_experiment.py +854 -0
- loopx/domain_state.py +137 -0
- loopx/dreaming.py +706 -0
- loopx/entrypoint.py +16 -0
- loopx/event_sourced_state.py +981 -0
- loopx/execution_profile.py +286 -0
- loopx/experiments/__init__.py +1 -0
- loopx/experiments/planner_worker/__init__.py +1 -0
- loopx/experiments/planner_worker/contract.py +523 -0
- loopx/experiments/planner_worker/runtime.py +391 -0
- loopx/experiments/planner_worker/traex.py +461 -0
- loopx/explore_graph.py +11 -0
- loopx/extensions/__init__.py +1 -0
- loopx/extensions/bundled.py +28 -0
- loopx/extensions/execution_envelope.py +126 -0
- loopx/extensions/lark/__init__.py +11 -0
- loopx/extensions/lark/event_collector.py +478 -0
- loopx/extensions/lark/event_collector_runtime.py +506 -0
- loopx/extensions/lark/event_inbox.py +454 -0
- loopx/extensions/lark/extension.toml +88 -0
- loopx/extensions/lark/goal_channel.py +44 -0
- loopx/extensions/lark/goal_channel_contracts.py +388 -0
- loopx/extensions/lark/goal_channel_lifecycle.py +218 -0
- loopx/extensions/lark/goal_channel_runtime.py +792 -0
- loopx/extensions/lark/goal_channel_setup.py +805 -0
- loopx/extensions/lark/goal_channel_targets.py +215 -0
- loopx/extensions/lark/goal_channel_transport.py +281 -0
- loopx/extensions/lark/inbox_reactions.py +650 -0
- loopx/extensions/lark/inbox_reply.py +430 -0
- loopx/extensions/lark/presentation/__init__.py +11 -0
- loopx/extensions/lark/presentation/explore_results.py +2276 -0
- loopx/extensions/lark/presentation/explore_singleflight.py +127 -0
- loopx/extensions/lark/presentation/explore_source_guard.py +121 -0
- loopx/extensions/lark/presentation/explore_stage_document.py +703 -0
- loopx/extensions/lark/presentation/explore_visual_integrity.py +122 -0
- loopx/extensions/lark/presentation/explore_visual_readback.py +452 -0
- loopx/extensions/lark/presentation/explore_visual_styles.py +156 -0
- loopx/extensions/lark/presentation/issue_fix_surface.py +612 -0
- loopx/extensions/lark/presentation/kanban.py +2791 -0
- loopx/extensions/lark/presentation/message_card.py +112 -0
- loopx/extensions/lark/presentation/periodic_report.py +261 -0
- loopx/extensions/lark/presentation/projection_rows.py +600 -0
- loopx/extensions/lark/presentation/record_io.py +95 -0
- loopx/extensions/lark/presentation/sync_receipt.py +145 -0
- loopx/extensions/lark/private_json.py +40 -0
- loopx/extensions/lark/provider.py +86 -0
- loopx/extensions/lark/reviewer_notification.py +604 -0
- loopx/extensions/manifest.py +385 -0
- loopx/extensions/openviking_periodic_report/__init__.py +17 -0
- loopx/extensions/openviking_periodic_report/activation.py +173 -0
- loopx/extensions/openviking_periodic_report/extension.toml +17 -0
- loopx/extensions/openviking_periodic_report/provider.py +355 -0
- loopx/extensions/openviking_periodic_report/sink.py +117 -0
- loopx/extensions/openviking_semantic_preference/__init__.py +5 -0
- loopx/extensions/openviking_semantic_preference/extension.toml +16 -0
- loopx/extensions/openviking_semantic_preference/history_export.py +484 -0
- loopx/extensions/openviking_semantic_preference/project_peer.py +68 -0
- loopx/extensions/openviking_semantic_preference/provider.py +312 -0
- loopx/extensions/presentation.py +979 -0
- loopx/extensions/process_runtime.py +204 -0
- loopx/extensions/readiness.py +168 -0
- loopx/extensions/runtime.py +931 -0
- loopx/extensions/scaffold.py +335 -0
- loopx/feedback.py +581 -0
- loopx/file_lock.py +382 -0
- loopx/global_registry.py +842 -0
- loopx/global_risks.py +970 -0
- loopx/global_todos.py +568 -0
- loopx/handoff_budget.py +28 -0
- loopx/heartbeat_prequota.py +80 -0
- loopx/heartbeat_prompt.py +159 -0
- loopx/help_surface.py +516 -0
- loopx/history.py +1507 -0
- loopx/host_loop_activation.py +1311 -0
- loopx/host_mode_planner.py +991 -0
- loopx/install_contract.py +1 -0
- loopx/interface_budget.py +196 -0
- loopx/long_task_cadence.py +208 -0
- loopx/materials.py +185 -0
- loopx/ml_experiment.py +3 -0
- loopx/onboarding.py +214 -0
- loopx/opencode2_goal_mode/README.md +81 -0
- loopx/opencode2_goal_mode/__init__.py +9 -0
- loopx/opencode2_goal_mode/opencode2-goal-worker.mjs +1018 -0
- loopx/opencode_goal_mode/README.md +99 -0
- loopx/opencode_goal_mode/__init__.py +13 -0
- loopx/opencode_goal_mode/goal-bridge-runtime.mjs +858 -0
- loopx/opencode_goal_mode/loopx-goal.js +8 -0
- loopx/operator_gate.py +420 -0
- loopx/orchestration.py +127 -0
- loopx/paths.py +59 -0
- loopx/pi_goal_mode/README.md +67 -0
- loopx/pi_goal_mode/__init__.py +13 -0
- loopx/pi_goal_mode/loopx-goal.ts +254 -0
- loopx/pi_goal_mode/pi-goal-loop-runtime.mjs +574 -0
- loopx/pr_review.py +1206 -0
- loopx/presentation/__init__.py +1 -0
- loopx/presentation/explore_views.py +1334 -0
- loopx/presentation/markdown.py +61 -0
- loopx/presentation/projection_source_reconcile.py +140 -0
- loopx/presentation/public_safety.py +42 -0
- loopx/presentation/renderers/__init__.py +17 -0
- loopx/presentation/renderers/goal_channel_html.py +269 -0
- loopx/presentation/renderers/periodic_report_html.py +786 -0
- loopx/presentation/renderers/periodic_report_markdown.py +184 -0
- loopx/presentation/renderers/quota_event_markdown.py +116 -0
- loopx/presentation/renderers/quota_markdown.py +1112 -0
- loopx/presentation/renderers/status_markdown.py +1570 -0
- loopx/presentation/renderers/trajectory_hygiene_markdown.py +39 -0
- loopx/presentation/renderers/turn_envelope_markdown.py +33 -0
- loopx/presentation/sinks/__init__.py +5 -0
- loopx/presentation/sinks/openviking_periodic_report.py +7 -0
- loopx/presentation/static_site.py +691 -0
- loopx/presets.py +369 -0
- loopx/project_alias.py +217 -0
- loopx/project_map.py +589 -0
- loopx/project_prompt.py +1153 -0
- loopx/project_skill_cli.py +125 -0
- loopx/project_skill_delivery.py +470 -0
- loopx/project_uninstall.py +462 -0
- loopx/promotion_gate.py +197 -0
- loopx/quota.py +1197 -0
- loopx/ready_score.py +413 -0
- loopx/registry.py +621 -0
- loopx/registry_writability.py +64 -0
- loopx/release_candidate.py +148 -0
- loopx/release_manifest.py +316 -0
- loopx/repository_identity.py +100 -0
- loopx/review_packet.py +1024 -0
- loopx/rollout_event_log.py +505 -0
- loopx/runtime.py +112 -0
- loopx/self_update.py +750 -0
- loopx/session_runtime.py +418 -0
- loopx/skill_install_readback.py +500 -0
- loopx/slash_command_install.py +1393 -0
- loopx/slash_commands.py +264 -0
- loopx/state_backup.py +573 -0
- loopx/state_migration.py +350 -0
- loopx/state_projection.py +809 -0
- loopx/state_refresh.py +1416 -0
- loopx/status.py +1383 -0
- loopx/status_server.py +935 -0
- loopx/summary_all.py +725 -0
- loopx/terminal_bench_agent.py +2056 -0
- loopx/thread_agent_binding.py +408 -0
- loopx/todo_followups.py +168 -0
- loopx/todo_suggestion_prompt.py +204 -0
- loopx/todos.py +2229 -0
- loopx/turn_identity.py +17 -0
- loopx/upgrade.py +1083 -0
- loopx/visible_governance.py +667 -0
- loopx/visible_multi_agent_launcher.py +1253 -0
- loopx/visible_multi_agent_tmux.py +429 -0
- loopx/worker_bridge.py +1574 -0
- loopx-0.4.8.dist-info/METADATA +708 -0
- loopx-0.4.8.dist-info/RECORD +811 -0
- loopx-0.4.8.dist-info/WHEEL +5 -0
- loopx-0.4.8.dist-info/entry_points.txt +5 -0
- loopx-0.4.8.dist-info/licenses/LICENSE +202 -0
- loopx-0.4.8.dist-info/licenses/LICENSE-MIT +21 -0
- loopx-0.4.8.dist-info/licenses/NOTICE +6 -0
- loopx-0.4.8.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1112 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from ...control_plane import control_plane_policy_summary
|
|
6
|
+
from ...execution_profile import execution_profile_summary
|
|
7
|
+
from ...long_task_cadence import long_task_cadence_hint_summary
|
|
8
|
+
from ...orchestration import orchestration_policy_summary
|
|
9
|
+
from ...control_plane.quota.states import QUOTA_STATE_ORDER
|
|
10
|
+
from ...control_plane.runtime.decision_freshness import (
|
|
11
|
+
DECISION_FRESHNESS_WARNING_ITEM_LIMIT,
|
|
12
|
+
)
|
|
13
|
+
from ..markdown import (
|
|
14
|
+
append_operator_action_markdown,
|
|
15
|
+
as_dict,
|
|
16
|
+
as_list,
|
|
17
|
+
markdown_scalar,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _append_fallback_projection_markdown(
|
|
22
|
+
lines: list[str],
|
|
23
|
+
fallback: dict[str, Any],
|
|
24
|
+
*,
|
|
25
|
+
label: str,
|
|
26
|
+
blocked_items_key: str,
|
|
27
|
+
blocked_item_label: str,
|
|
28
|
+
blocked_gate_key: str | None = None,
|
|
29
|
+
) -> None:
|
|
30
|
+
if not fallback:
|
|
31
|
+
return
|
|
32
|
+
selected = as_dict(fallback.get("selected_executable"))
|
|
33
|
+
blocked_items = as_list(fallback.get(blocked_items_key))
|
|
34
|
+
lines.append(
|
|
35
|
+
f"- {label}_fallback: "
|
|
36
|
+
f"notify_user={fallback.get('notify_user')} "
|
|
37
|
+
f"blocked_count={len(blocked_items)} "
|
|
38
|
+
f"selected_index={selected.get('index')} "
|
|
39
|
+
f"reason={fallback.get('reason')}"
|
|
40
|
+
)
|
|
41
|
+
blocked_gate = as_dict(fallback.get(blocked_gate_key)) if blocked_gate_key else {}
|
|
42
|
+
if blocked_gate.get("text"):
|
|
43
|
+
lines.append(f"- {label}: {blocked_gate.get('text')}")
|
|
44
|
+
for blocked in blocked_items[:3]:
|
|
45
|
+
if not isinstance(blocked, dict):
|
|
46
|
+
continue
|
|
47
|
+
text = str(blocked.get("text") or "").strip()
|
|
48
|
+
if not text:
|
|
49
|
+
continue
|
|
50
|
+
index = blocked.get("index")
|
|
51
|
+
suffix = f"[{index}]" if index is not None else ""
|
|
52
|
+
lines.append(f"- {blocked_item_label}{suffix}: {text}")
|
|
53
|
+
if selected.get("text"):
|
|
54
|
+
lines.append(f"- {label}_selected: {selected.get('text')}")
|
|
55
|
+
if fallback.get("recommended_action"):
|
|
56
|
+
lines.append(f"- {label}_action: {fallback.get('recommended_action')}")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _compact_todo_identity(todo: dict[str, Any]) -> str:
|
|
60
|
+
return " ".join(
|
|
61
|
+
f"{key}={value}"
|
|
62
|
+
for key in ("todo_id", "status", "priority", "task_class", "action_kind")
|
|
63
|
+
if (value := str(todo.get(key) or "").strip())
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _render_todo_row(todo: Any, *, label: str, row_kind: str) -> tuple[tuple[str, Any, str], str] | None:
|
|
68
|
+
if not isinstance(todo, dict):
|
|
69
|
+
return None
|
|
70
|
+
text = str(todo.get("text") or "").strip()
|
|
71
|
+
if not text:
|
|
72
|
+
return None
|
|
73
|
+
index = todo.get("index")
|
|
74
|
+
suffix = f"[{index}]" if index is not None else ""
|
|
75
|
+
metadata = ""
|
|
76
|
+
if row_kind == "next" and label == "agent_todo" and todo.get("todo_id"):
|
|
77
|
+
metadata = f" todo_id={todo.get('todo_id')}"
|
|
78
|
+
elif todo.get("claimed_by"):
|
|
79
|
+
metadata = f" claimed_by={todo.get('claimed_by')}"
|
|
80
|
+
key = (str(todo.get("todo_id") or ""), todo.get("index"), text)
|
|
81
|
+
return key, f"- {label}_{row_kind}{suffix}: {text}{metadata}"
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _append_todo_summary(lines: list[str], label: str, summary: dict[str, Any]) -> None:
|
|
85
|
+
summary_parts = [
|
|
86
|
+
f"open={summary.get('open_count')}",
|
|
87
|
+
f"total={summary.get('total_count')}",
|
|
88
|
+
]
|
|
89
|
+
if summary.get("claimed_open_count"):
|
|
90
|
+
summary_parts[1:1] = [
|
|
91
|
+
f"claimed={summary.get('claimed_open_count')}",
|
|
92
|
+
f"unclaimed={summary.get('unclaimed_open_count', 0)}",
|
|
93
|
+
]
|
|
94
|
+
for key, name in (
|
|
95
|
+
("monitor_due_count", "monitor_due"),
|
|
96
|
+
("monitor_schedule_gap_count", "monitor_schedule_gap"),
|
|
97
|
+
("current_agent_blocker_count", "current_agent_blocker"),
|
|
98
|
+
("completed_without_successor_count", "succession_warning"),
|
|
99
|
+
):
|
|
100
|
+
if summary.get(key):
|
|
101
|
+
summary_parts.append(f"{name}={summary.get(key)}")
|
|
102
|
+
lines.append(f"- {label}_summary: {' '.join(summary_parts)}")
|
|
103
|
+
|
|
104
|
+
for lane, suffix, limit in (
|
|
105
|
+
("unclaimed_priority_open_items", "unclaimed_candidates", 3),
|
|
106
|
+
("monitor_due_items", "monitor_due", 1),
|
|
107
|
+
("monitor_capability_blocked_due_items", "monitor_capability_blocked_due", 2),
|
|
108
|
+
("monitor_schedule_gap_items", "monitor_schedule_gap", 1),
|
|
109
|
+
("current_agent_blocker_items", "current_agent_blocker", 2),
|
|
110
|
+
):
|
|
111
|
+
lane_items = as_list(summary.get(lane))
|
|
112
|
+
identities = [
|
|
113
|
+
(
|
|
114
|
+
f"{_compact_todo_identity(item)} "
|
|
115
|
+
f"reason={str(item.get('reason') or '').strip()[:120]}"
|
|
116
|
+
if lane == "current_agent_blocker_items"
|
|
117
|
+
and str(item.get("reason") or "").strip()
|
|
118
|
+
else _compact_todo_identity(item)
|
|
119
|
+
)
|
|
120
|
+
for item in lane_items[:limit]
|
|
121
|
+
if isinstance(item, dict) and item.get("todo_id")
|
|
122
|
+
]
|
|
123
|
+
if identities:
|
|
124
|
+
lines.append(f"- {label}_{suffix}: {'; '.join(identities)}")
|
|
125
|
+
|
|
126
|
+
succession_warning = as_dict(summary.get("todo_succession_warning"))
|
|
127
|
+
if succession_warning:
|
|
128
|
+
projected_todo_ids = as_list(succession_warning.get("todo_ids"))
|
|
129
|
+
warning_items = as_list(succession_warning.get("items"))
|
|
130
|
+
todo_ids = [
|
|
131
|
+
str(todo_id)
|
|
132
|
+
for todo_id in projected_todo_ids[:3]
|
|
133
|
+
if str(todo_id or "").strip()
|
|
134
|
+
] or [
|
|
135
|
+
str(item.get("todo_id"))
|
|
136
|
+
for item in warning_items[:3]
|
|
137
|
+
if isinstance(item, dict) and item.get("todo_id")
|
|
138
|
+
]
|
|
139
|
+
todo_ids_text = ",".join(todo_ids) if todo_ids else "n/a"
|
|
140
|
+
lines.append(
|
|
141
|
+
f"- {label}_succession_warning: "
|
|
142
|
+
f"reason={succession_warning.get('reason_code')} "
|
|
143
|
+
f"count={succession_warning.get('count')} "
|
|
144
|
+
f"todo_ids={todo_ids_text}"
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
first_open_key = (
|
|
148
|
+
"first_executable_items"
|
|
149
|
+
if label == "agent_todo"
|
|
150
|
+
and isinstance(summary.get("first_executable_items"), list)
|
|
151
|
+
else "first_open_items"
|
|
152
|
+
)
|
|
153
|
+
first_open = list(as_list(summary.get(first_open_key)))
|
|
154
|
+
if label == "user_todo" and isinstance(summary.get("user_action_items"), list):
|
|
155
|
+
first_open.extend(
|
|
156
|
+
item
|
|
157
|
+
for item in summary.get("user_action_items", [])
|
|
158
|
+
if isinstance(item, dict)
|
|
159
|
+
)
|
|
160
|
+
for todo in first_open[:3]:
|
|
161
|
+
if row := _render_todo_row(todo, label=label, row_kind="next"):
|
|
162
|
+
lines.append(row[1])
|
|
163
|
+
|
|
164
|
+
first_keys = {
|
|
165
|
+
(
|
|
166
|
+
str(todo.get("todo_id") or ""),
|
|
167
|
+
todo.get("index"),
|
|
168
|
+
str(todo.get("text") or "").strip(),
|
|
169
|
+
)
|
|
170
|
+
for todo in first_open
|
|
171
|
+
if isinstance(todo, dict)
|
|
172
|
+
}
|
|
173
|
+
extra_count = 0
|
|
174
|
+
for todo in as_list(summary.get("backlog_items")):
|
|
175
|
+
row = _render_todo_row(todo, label=label, row_kind="backlog")
|
|
176
|
+
if row is None or row[0] in first_keys:
|
|
177
|
+
continue
|
|
178
|
+
lines.append(row[1])
|
|
179
|
+
extra_count += 1
|
|
180
|
+
if extra_count >= 5:
|
|
181
|
+
break
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def render_quota_markdown(payload: dict[str, Any]) -> str:
|
|
185
|
+
title = "Quota Plan" if payload.get("mode") == "plan" else "Quota Status"
|
|
186
|
+
lines = [
|
|
187
|
+
f"# LoopX {title}",
|
|
188
|
+
"",
|
|
189
|
+
f"- ok: `{payload.get('ok')}`",
|
|
190
|
+
f"- registry: `{payload.get('registry')}`",
|
|
191
|
+
f"- runtime_root: `{payload.get('runtime_root')}`",
|
|
192
|
+
f"- goals: `{payload.get('goal_count')}`",
|
|
193
|
+
f"- runs: `{payload.get('run_count')}`",
|
|
194
|
+
]
|
|
195
|
+
summary = as_dict(payload.get("summary"))
|
|
196
|
+
states = as_dict(summary.get("states"))
|
|
197
|
+
state_text = ", ".join(f"{state}={states.get(state, 0)}" for state in QUOTA_STATE_ORDER)
|
|
198
|
+
lines.append(
|
|
199
|
+
"- summary: "
|
|
200
|
+
f"registered_goals={summary.get('registered_goals')}, "
|
|
201
|
+
f"health_blockers={summary.get('health_blockers')}, "
|
|
202
|
+
f"next_automatic_turn={summary.get('next_automatic_turn') or 'none'}"
|
|
203
|
+
)
|
|
204
|
+
lines.append(f"- states: {state_text}")
|
|
205
|
+
|
|
206
|
+
next_turn = as_dict(payload.get("next_automatic_turn"))
|
|
207
|
+
lines.extend(["", "## Next Automatic Turn"])
|
|
208
|
+
if next_turn:
|
|
209
|
+
quota = as_dict(next_turn.get("quota"))
|
|
210
|
+
lines.append(
|
|
211
|
+
"- "
|
|
212
|
+
f"`{next_turn.get('goal_id')}` "
|
|
213
|
+
f"compute={quota.get('compute')} "
|
|
214
|
+
f"slot_minutes={quota.get('slot_minutes')} "
|
|
215
|
+
f"slots={quota.get('spent_slots')}/{quota.get('allowed_slots')} "
|
|
216
|
+
f"action={next_turn.get('recommended_action') or 'inspect latest run'}"
|
|
217
|
+
)
|
|
218
|
+
else:
|
|
219
|
+
lines.append("- none")
|
|
220
|
+
|
|
221
|
+
health_items = as_list(payload.get("health_items"))
|
|
222
|
+
if health_items:
|
|
223
|
+
lines.extend(["", "## Health Items"])
|
|
224
|
+
for item in health_items:
|
|
225
|
+
if not isinstance(item, dict):
|
|
226
|
+
continue
|
|
227
|
+
lines.append(
|
|
228
|
+
"- "
|
|
229
|
+
f"`{item.get('goal_id')}` "
|
|
230
|
+
f"severity={item.get('severity')} "
|
|
231
|
+
f"waiting_on={item.get('waiting_on')} "
|
|
232
|
+
f"action={item.get('recommended_action')}"
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
groups = as_dict(payload.get("groups"))
|
|
236
|
+
lines.extend(["", "## Groups"])
|
|
237
|
+
render_states = list(QUOTA_STATE_ORDER)
|
|
238
|
+
if groups.get("unknown"):
|
|
239
|
+
render_states.append("unknown")
|
|
240
|
+
for state in render_states:
|
|
241
|
+
items = as_list(groups.get(state))
|
|
242
|
+
if payload.get("mode") == "plan" and not items:
|
|
243
|
+
continue
|
|
244
|
+
lines.extend(["", f"### {state}"])
|
|
245
|
+
if not items:
|
|
246
|
+
lines.append("- none")
|
|
247
|
+
continue
|
|
248
|
+
for item in items:
|
|
249
|
+
if not isinstance(item, dict):
|
|
250
|
+
continue
|
|
251
|
+
quota = as_dict(item.get("quota"))
|
|
252
|
+
action = markdown_scalar(item.get("recommended_action") or "")
|
|
253
|
+
lines.append(
|
|
254
|
+
"- "
|
|
255
|
+
f"`{item.get('goal_id')}`: "
|
|
256
|
+
f"compute={quota.get('compute')} "
|
|
257
|
+
f"slot_minutes={quota.get('slot_minutes')} "
|
|
258
|
+
f"slots={quota.get('spent_slots')}/{quota.get('allowed_slots')} "
|
|
259
|
+
f"waiting_on={item.get('waiting_on')} "
|
|
260
|
+
f"status={item.get('status')} "
|
|
261
|
+
f"phase={item.get('lifecycle_phase')}"
|
|
262
|
+
)
|
|
263
|
+
reason = quota.get("reason")
|
|
264
|
+
if reason:
|
|
265
|
+
lines.append(f" - reason: {reason}")
|
|
266
|
+
if action:
|
|
267
|
+
lines.append(f" - action: {action}")
|
|
268
|
+
control_plane = as_dict(item.get("control_plane"))
|
|
269
|
+
if control_plane:
|
|
270
|
+
lines.append(f" - control_plane: {control_plane_policy_summary(control_plane)}")
|
|
271
|
+
if item.get("agent_command"):
|
|
272
|
+
lines.append(f" - agent_command: `{item.get('agent_command')}`")
|
|
273
|
+
if item.get("next_handoff_condition"):
|
|
274
|
+
lines.append(f" - next_handoff_condition: {item.get('next_handoff_condition')}")
|
|
275
|
+
append_operator_action_markdown(lines, payload)
|
|
276
|
+
return "\n".join(lines)
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def render_quota_scheduler_ack_markdown(payload: dict[str, Any]) -> str:
|
|
280
|
+
event = as_dict(payload.get("scheduler_ack_event"))
|
|
281
|
+
state = as_dict(event.get("scheduler_state"))
|
|
282
|
+
before = as_dict(event.get("before"))
|
|
283
|
+
lines = [
|
|
284
|
+
"# LoopX Quota Scheduler Ack",
|
|
285
|
+
"",
|
|
286
|
+
f"- goal_id: `{payload.get('goal_id')}`",
|
|
287
|
+
f"- classification: `{payload.get('classification')}`",
|
|
288
|
+
f"- agent_id: `{payload.get('agent_id') or event.get('agent_id') or state.get('agent_id') or ''}`",
|
|
289
|
+
f"- surface: `{payload.get('surface') or event.get('surface')}`",
|
|
290
|
+
f"- state_key: `{payload.get('state_key') or event.get('state_key')}`",
|
|
291
|
+
f"- applied_rrule: `{payload.get('applied_rrule') or event.get('applied_rrule')}`",
|
|
292
|
+
f"- progression_index: `{state.get('progression_index')}`",
|
|
293
|
+
f"- reset_token: `{state.get('reset_token') or ''}`",
|
|
294
|
+
f"- identity_signature: `{state.get('identity_signature') or ''}`",
|
|
295
|
+
f"- appended: `{payload.get('appended')}`",
|
|
296
|
+
f"- registry_mutated: `{payload.get('registry_mutated')}`",
|
|
297
|
+
f"- effective_action: `{before.get('effective_action')}`",
|
|
298
|
+
f"- state: `{before.get('state')}`",
|
|
299
|
+
f"- should_run: `{before.get('should_run')}`",
|
|
300
|
+
f"- health_check: {payload.get('health_check') or 'scheduler ack state updated; no quota spend'}",
|
|
301
|
+
]
|
|
302
|
+
if payload.get("scheduler_state_path"):
|
|
303
|
+
lines.append(f"- scheduler_state_path: `{payload.get('scheduler_state_path')}`")
|
|
304
|
+
if payload.get("reason"):
|
|
305
|
+
lines.append(f"- reason: {payload.get('reason')}")
|
|
306
|
+
append_operator_action_markdown(lines, payload)
|
|
307
|
+
return "\n".join(lines)
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
def render_quota_scheduler_failure_markdown(payload: dict[str, Any]) -> str:
|
|
311
|
+
event = as_dict(payload.get("scheduler_failure_event"))
|
|
312
|
+
state = as_dict(event.get("scheduler_state"))
|
|
313
|
+
failure = as_dict(state.get("host_update_failure"))
|
|
314
|
+
before = as_dict(event.get("before"))
|
|
315
|
+
lines = [
|
|
316
|
+
"# LoopX Quota Scheduler Host Update Failure",
|
|
317
|
+
"",
|
|
318
|
+
f"- goal_id: `{payload.get('goal_id')}`",
|
|
319
|
+
f"- classification: `{payload.get('classification')}`",
|
|
320
|
+
f"- agent_id: `{payload.get('agent_id') or state.get('agent_id') or ''}`",
|
|
321
|
+
f"- surface: `{payload.get('surface') or event.get('surface')}`",
|
|
322
|
+
f"- state_key: `{payload.get('state_key') or event.get('state_key')}`",
|
|
323
|
+
f"- failed_rrule: `{payload.get('failed_rrule') or failure.get('target_rrule')}`",
|
|
324
|
+
f"- observed_host_rrule: `{payload.get('observed_host_rrule') or failure.get('observed_host_rrule') or ''}`",
|
|
325
|
+
f"- failure_kind: `{payload.get('failure_kind') or failure.get('failure_kind')}`",
|
|
326
|
+
f"- failure_count: `{failure.get('failure_count')}`",
|
|
327
|
+
f"- scheduler_state_mutated: `{payload.get('scheduler_state_mutated')}`",
|
|
328
|
+
f"- effective_action: `{before.get('effective_action')}`",
|
|
329
|
+
f"- should_run: `{before.get('should_run')}`",
|
|
330
|
+
f"- health_check: {payload.get('health_check') or 'scheduler host update failure recorded; no quota spend'}",
|
|
331
|
+
]
|
|
332
|
+
if payload.get("scheduler_state_path"):
|
|
333
|
+
lines.append(f"- scheduler_state_path: `{payload.get('scheduler_state_path')}`")
|
|
334
|
+
if payload.get("reason"):
|
|
335
|
+
lines.append(f"- reason: {payload.get('reason')}")
|
|
336
|
+
append_operator_action_markdown(lines, payload)
|
|
337
|
+
return "\n".join(lines)
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
def render_quota_should_run_markdown(payload: dict[str, Any]) -> str:
|
|
341
|
+
quota = as_dict(payload.get("quota"))
|
|
342
|
+
lines = [
|
|
343
|
+
"# LoopX Quota Should Run",
|
|
344
|
+
"",
|
|
345
|
+
f"- ok: `{payload.get('ok')}`",
|
|
346
|
+
f"- goal_id: `{payload.get('goal_id')}`",
|
|
347
|
+
f"- decision: `{payload.get('decision')}`",
|
|
348
|
+
f"- should_run: `{payload.get('should_run')}`",
|
|
349
|
+
f"- normal_delivery_allowed: `{payload.get('normal_delivery_allowed')}`",
|
|
350
|
+
f"- recovery_delivery_allowed: `{payload.get('recovery_delivery_allowed')}`",
|
|
351
|
+
f"- self_repair_allowed: `{payload.get('self_repair_allowed')}`",
|
|
352
|
+
f"- effective_action: `{payload.get('effective_action')}`",
|
|
353
|
+
f"- actionable_by_codex: `{payload.get('actionable_by_codex')}`",
|
|
354
|
+
f"- state: `{payload.get('state')}`",
|
|
355
|
+
f"- waiting_on: `{payload.get('waiting_on')}`",
|
|
356
|
+
f"- status: `{payload.get('status')}`",
|
|
357
|
+
]
|
|
358
|
+
if payload.get("project_asset_source"):
|
|
359
|
+
lines.append(f"- project_asset_source: {payload.get('project_asset_source')}")
|
|
360
|
+
agent_identity = as_dict(payload.get("agent_identity"))
|
|
361
|
+
if agent_identity:
|
|
362
|
+
lines.append(
|
|
363
|
+
"- agent_identity: "
|
|
364
|
+
f"agent_id={agent_identity.get('agent_id')} agent_model=peer_v1"
|
|
365
|
+
)
|
|
366
|
+
if payload.get("active_state_next_action"):
|
|
367
|
+
lines.append(f"- active_state_next_action: {markdown_scalar(payload.get('active_state_next_action'))}")
|
|
368
|
+
if payload.get("latest_run_recommended_action"):
|
|
369
|
+
lines.append(
|
|
370
|
+
f"- latest_run_recommended_action: {markdown_scalar(payload.get('latest_run_recommended_action'))}"
|
|
371
|
+
)
|
|
372
|
+
agent_lane_next_action = as_dict(payload.get("agent_lane_next_action"))
|
|
373
|
+
if agent_lane_next_action:
|
|
374
|
+
lines.append(
|
|
375
|
+
"- agent_lane_next_action: "
|
|
376
|
+
f"todo_id={agent_lane_next_action.get('todo_id')} "
|
|
377
|
+
f"selected_by={agent_lane_next_action.get('selected_by')} "
|
|
378
|
+
f"confidence={agent_lane_next_action.get('confidence')}"
|
|
379
|
+
)
|
|
380
|
+
if agent_lane_next_action.get("text"):
|
|
381
|
+
lines.append(
|
|
382
|
+
f"- agent_lane_next_action_text: {markdown_scalar(agent_lane_next_action.get('text'))}"
|
|
383
|
+
)
|
|
384
|
+
agent_lane_frontier_hint = as_dict(payload.get("agent_lane_frontier_hint"))
|
|
385
|
+
if agent_lane_frontier_hint:
|
|
386
|
+
lines.append(
|
|
387
|
+
"- agent_lane_frontier_hint: "
|
|
388
|
+
f"decision={agent_lane_frontier_hint.get('decision')} "
|
|
389
|
+
f"source={agent_lane_frontier_hint.get('source')} "
|
|
390
|
+
f"reason_code={agent_lane_frontier_hint.get('reason_code')} "
|
|
391
|
+
f"target_todo_id={agent_lane_frontier_hint.get('target_todo_id')}"
|
|
392
|
+
)
|
|
393
|
+
goal_route_hint = as_dict(payload.get("goal_route_hint"))
|
|
394
|
+
if goal_route_hint:
|
|
395
|
+
counts = as_dict(goal_route_hint.get("counts"))
|
|
396
|
+
lines.append(
|
|
397
|
+
"- goal_route_hint: "
|
|
398
|
+
f"decision={goal_route_hint.get('route_decision')} "
|
|
399
|
+
f"agent_id={goal_route_hint.get('agent_id')} "
|
|
400
|
+
f"preserves_goal_next_action={goal_route_hint.get('preserves_goal_next_action')} "
|
|
401
|
+
f"other_agent_claimed_advancement_count={counts.get('other_agent_claimed_advancement_count')}"
|
|
402
|
+
)
|
|
403
|
+
current_action = as_dict(goal_route_hint.get("current_agent_next_action"))
|
|
404
|
+
if current_action:
|
|
405
|
+
lines.append(
|
|
406
|
+
"- goal_route_hint_current_action: "
|
|
407
|
+
f"todo_id={current_action.get('todo_id')} "
|
|
408
|
+
f"selected_by={current_action.get('selected_by')}"
|
|
409
|
+
)
|
|
410
|
+
agent_scope_frontier = as_dict(payload.get("agent_scope_frontier"))
|
|
411
|
+
if agent_scope_frontier:
|
|
412
|
+
lines.append(
|
|
413
|
+
"- agent_scope_frontier: "
|
|
414
|
+
f"action={agent_scope_frontier.get('action')} "
|
|
415
|
+
f"agent_id={agent_scope_frontier.get('agent_id')} "
|
|
416
|
+
f"quiet_noop_allowed={agent_scope_frontier.get('quiet_noop_allowed')}"
|
|
417
|
+
)
|
|
418
|
+
if agent_scope_frontier.get("reason"):
|
|
419
|
+
lines.append(
|
|
420
|
+
f"- agent_scope_frontier_reason: {markdown_scalar(agent_scope_frontier.get('reason'))}"
|
|
421
|
+
)
|
|
422
|
+
deferred_resume_candidates = as_list(agent_scope_frontier.get("deferred_resume_candidates"))
|
|
423
|
+
if deferred_resume_candidates:
|
|
424
|
+
first_candidate = as_dict(deferred_resume_candidates[0])
|
|
425
|
+
lines.append(
|
|
426
|
+
"- agent_scope_deferred_resume_candidates: "
|
|
427
|
+
f"`{len(deferred_resume_candidates)}` "
|
|
428
|
+
f"top_todo_id={first_candidate.get('todo_id')}"
|
|
429
|
+
)
|
|
430
|
+
route_continuation_candidates = as_list(
|
|
431
|
+
agent_scope_frontier.get("route_continuation_replan_candidates")
|
|
432
|
+
)
|
|
433
|
+
if route_continuation_candidates:
|
|
434
|
+
first_candidate = as_dict(route_continuation_candidates[0])
|
|
435
|
+
lines.append(
|
|
436
|
+
"- agent_scope_route_continuation_replan_candidates: "
|
|
437
|
+
f"`{len(route_continuation_candidates)}` "
|
|
438
|
+
f"top_todo_id={first_candidate.get('todo_id')} "
|
|
439
|
+
f"route={first_candidate.get('route_id') or first_candidate.get('route_key') or ''}"
|
|
440
|
+
)
|
|
441
|
+
goal_frontier = as_dict(payload.get("goal_frontier_projection"))
|
|
442
|
+
if goal_frontier:
|
|
443
|
+
remaining = as_dict(goal_frontier.get("remaining_advancement_frontier"))
|
|
444
|
+
deferred_successors = as_dict(goal_frontier.get("deferred_successors"))
|
|
445
|
+
acceptance_gaps = as_list(goal_frontier.get("acceptance_gaps"))
|
|
446
|
+
lines.append(
|
|
447
|
+
"- goal_frontier_projection: "
|
|
448
|
+
f"replan_required={goal_frontier.get('replan_required')} "
|
|
449
|
+
f"current_agent_advancement={remaining.get('current_agent_claimed_advancement_count')} "
|
|
450
|
+
f"unclaimed_advancement={remaining.get('unclaimed_advancement_count')} "
|
|
451
|
+
f"other_agent_advancement={remaining.get('other_agent_claimed_advancement_count')} "
|
|
452
|
+
f"deferred_ready={deferred_successors.get('ready_count')} "
|
|
453
|
+
f"acceptance_gaps={len(acceptance_gaps)}"
|
|
454
|
+
)
|
|
455
|
+
vision_audit = as_dict(goal_frontier.get("vision_continuation_audit"))
|
|
456
|
+
if vision_audit:
|
|
457
|
+
lines.append(
|
|
458
|
+
"- vision_continuation_audit: "
|
|
459
|
+
f"required={vision_audit.get('required')} "
|
|
460
|
+
f"decision={vision_audit.get('decision')} "
|
|
461
|
+
f"trigger_count={vision_audit.get('trigger_count')}"
|
|
462
|
+
)
|
|
463
|
+
vision_gap_judge = as_dict(vision_audit.get("vision_gap_judge"))
|
|
464
|
+
if vision_gap_judge:
|
|
465
|
+
lines.append(
|
|
466
|
+
"- vision_gap_judge: "
|
|
467
|
+
f"done={vision_gap_judge.get('done')} "
|
|
468
|
+
f"decision={vision_gap_judge.get('decision')}"
|
|
469
|
+
)
|
|
470
|
+
vision_wait_state = as_dict(goal_frontier.get("vision_wait_state"))
|
|
471
|
+
if vision_wait_state:
|
|
472
|
+
if vision_wait_state.get("reason_code") == "current_agent_blocker":
|
|
473
|
+
lines.append(
|
|
474
|
+
"- vision_wait_state: "
|
|
475
|
+
f"state={vision_wait_state.get('state')} "
|
|
476
|
+
f"todo_id={vision_wait_state.get('selected_todo_id')} "
|
|
477
|
+
f"reason={vision_wait_state.get('blocker_reason')} "
|
|
478
|
+
"automatic_resume=False"
|
|
479
|
+
)
|
|
480
|
+
else:
|
|
481
|
+
lines.append(
|
|
482
|
+
"- vision_wait_state: "
|
|
483
|
+
f"state={vision_wait_state.get('state')} "
|
|
484
|
+
f"todo_id={vision_wait_state.get('selected_todo_id')} "
|
|
485
|
+
f"resume_when={vision_wait_state.get('resume_when')} "
|
|
486
|
+
f"automatic_resume={vision_wait_state.get('automatic_resume')}"
|
|
487
|
+
)
|
|
488
|
+
task_orchestration = as_dict(payload.get("task_orchestration_contract"))
|
|
489
|
+
if task_orchestration:
|
|
490
|
+
lanes = as_list(task_orchestration.get("eligible_child_lanes"))
|
|
491
|
+
if not lanes:
|
|
492
|
+
lanes = as_list(task_orchestration.get("eligible_peer_lanes"))
|
|
493
|
+
blocked_lanes = as_list(task_orchestration.get("blocked_lanes"))
|
|
494
|
+
if not blocked_lanes:
|
|
495
|
+
blocked_lanes = as_list(task_orchestration.get("blocked_peer_lanes"))
|
|
496
|
+
lines.append(
|
|
497
|
+
"- task_orchestration: "
|
|
498
|
+
f"mode={task_orchestration.get('mode')} "
|
|
499
|
+
f"activation_required={task_orchestration.get('activation_required')} "
|
|
500
|
+
f"lanes={len(lanes)} "
|
|
501
|
+
f"blocked_lanes={len(blocked_lanes)} "
|
|
502
|
+
f"writeback_owner={task_orchestration.get('writeback_owner')}"
|
|
503
|
+
)
|
|
504
|
+
replan_decision = as_dict(payload.get("autonomous_replan_decision"))
|
|
505
|
+
if replan_decision:
|
|
506
|
+
lines.append(
|
|
507
|
+
"- autonomous_replan_decision: "
|
|
508
|
+
f"decision={replan_decision.get('decision')} "
|
|
509
|
+
f"plane={replan_decision.get('decision_plane')}"
|
|
510
|
+
)
|
|
511
|
+
automation_prompt_upgrade = as_dict(payload.get("automation_prompt_upgrade"))
|
|
512
|
+
if automation_prompt_upgrade:
|
|
513
|
+
lines.append(
|
|
514
|
+
"- automation_prompt_upgrade: "
|
|
515
|
+
f"required={automation_prompt_upgrade.get('required')} "
|
|
516
|
+
f"blocks_should_run={automation_prompt_upgrade.get('blocks_should_run')} "
|
|
517
|
+
f"contract={automation_prompt_upgrade.get('contract')} "
|
|
518
|
+
f"migration_id={automation_prompt_upgrade.get('migration_id')}"
|
|
519
|
+
)
|
|
520
|
+
if automation_prompt_upgrade.get("recommended_action"):
|
|
521
|
+
lines.append(f"- automation_prompt_upgrade_action: {automation_prompt_upgrade.get('recommended_action')}")
|
|
522
|
+
for example in as_list(automation_prompt_upgrade.get("agent_example_commands")):
|
|
523
|
+
if isinstance(example, dict) and example.get("command"):
|
|
524
|
+
lines.append(
|
|
525
|
+
f"- automation_prompt_upgrade_agent[{example.get('agent_id')}]: "
|
|
526
|
+
f"{example.get('command')}"
|
|
527
|
+
)
|
|
528
|
+
if automation_prompt_upgrade.get("completion_command"):
|
|
529
|
+
lines.append(
|
|
530
|
+
"- automation_prompt_upgrade_complete: "
|
|
531
|
+
f"{automation_prompt_upgrade.get('completion_command')}"
|
|
532
|
+
)
|
|
533
|
+
capability_gate = as_dict(payload.get("capability_gate"))
|
|
534
|
+
if capability_gate:
|
|
535
|
+
lines.append(
|
|
536
|
+
"- capability_gate: "
|
|
537
|
+
f"action={capability_gate.get('action')} "
|
|
538
|
+
f"required={capability_gate.get('required')} "
|
|
539
|
+
f"missing={capability_gate.get('missing')}"
|
|
540
|
+
)
|
|
541
|
+
if capability_gate.get("decision_owner"):
|
|
542
|
+
lines.append(f"- capability_gate_decision_owner: {capability_gate.get('decision_owner')}")
|
|
543
|
+
runnable_candidates = as_list(capability_gate.get("runnable_candidates"))
|
|
544
|
+
if runnable_candidates:
|
|
545
|
+
lines.append(f"- capability_gate_runnable_candidates: `{len(runnable_candidates)}`")
|
|
546
|
+
blocked_candidates = as_list(capability_gate.get("blocked_candidates"))
|
|
547
|
+
if blocked_candidates:
|
|
548
|
+
lines.append(f"- capability_gate_blocked_candidates: `{len(blocked_candidates)}`")
|
|
549
|
+
workspace_guard = as_dict(payload.get("workspace_guard"))
|
|
550
|
+
if workspace_guard:
|
|
551
|
+
lines.append(
|
|
552
|
+
"- workspace_guard: "
|
|
553
|
+
f"action={workspace_guard.get('action')} "
|
|
554
|
+
f"current_workspace={workspace_guard.get('current_workspace')} "
|
|
555
|
+
f"required_workspace={workspace_guard.get('required_workspace')}"
|
|
556
|
+
)
|
|
557
|
+
if workspace_guard.get("required_action"):
|
|
558
|
+
lines.append(f"- workspace_guard_action: {workspace_guard.get('required_action')}")
|
|
559
|
+
stale_latest_run_warning = as_dict(payload.get("stale_latest_run_warning"))
|
|
560
|
+
if stale_latest_run_warning:
|
|
561
|
+
lines.append(
|
|
562
|
+
"- stale_latest_run_warning: "
|
|
563
|
+
f"requires_refresh_state={stale_latest_run_warning.get('requires_refresh_state')} "
|
|
564
|
+
f"active_state_updated_at={stale_latest_run_warning.get('active_state_updated_at')} "
|
|
565
|
+
f"latest_run_generated_at={stale_latest_run_warning.get('latest_run_generated_at')} "
|
|
566
|
+
f"reason={stale_latest_run_warning.get('reason')}"
|
|
567
|
+
)
|
|
568
|
+
if stale_latest_run_warning.get("recommended_action"):
|
|
569
|
+
lines.append(f"- stale_latest_run_action: {stale_latest_run_warning.get('recommended_action')}")
|
|
570
|
+
state_action_projection_warning = as_dict(payload.get("state_action_projection_warning"))
|
|
571
|
+
if state_action_projection_warning:
|
|
572
|
+
lines.append(
|
|
573
|
+
"- state_action_projection_warning: "
|
|
574
|
+
f"requires_state_writeback={state_action_projection_warning.get('requires_state_writeback')} "
|
|
575
|
+
f"reason={state_action_projection_warning.get('reason')}"
|
|
576
|
+
)
|
|
577
|
+
if state_action_projection_warning.get("selected_recommended_action"):
|
|
578
|
+
lines.append(
|
|
579
|
+
"- state_action_selected: "
|
|
580
|
+
f"{state_action_projection_warning.get('selected_recommended_action')}"
|
|
581
|
+
)
|
|
582
|
+
if state_action_projection_warning.get("active_state_next_action"):
|
|
583
|
+
lines.append(
|
|
584
|
+
"- state_action_visible_next: "
|
|
585
|
+
f"{state_action_projection_warning.get('active_state_next_action')}"
|
|
586
|
+
)
|
|
587
|
+
if state_action_projection_warning.get("recommended_action"):
|
|
588
|
+
lines.append(
|
|
589
|
+
f"- state_action_projection_action: {state_action_projection_warning.get('recommended_action')}"
|
|
590
|
+
)
|
|
591
|
+
next_action_projection = as_dict(payload.get("next_action_projection_warning"))
|
|
592
|
+
if next_action_projection:
|
|
593
|
+
lines.append(
|
|
594
|
+
"- next_action_projection_warning: "
|
|
595
|
+
f"requires_state_writeback={next_action_projection.get('requires_state_writeback')} "
|
|
596
|
+
f"reason={next_action_projection.get('reason')}"
|
|
597
|
+
)
|
|
598
|
+
if next_action_projection.get("latest_run_recommended_action"):
|
|
599
|
+
lines.append(
|
|
600
|
+
"- latest_run_projection_action: "
|
|
601
|
+
f"{next_action_projection.get('latest_run_recommended_action')}"
|
|
602
|
+
)
|
|
603
|
+
backlog_hygiene_warning = as_dict(payload.get("backlog_hygiene_warning"))
|
|
604
|
+
if backlog_hygiene_warning:
|
|
605
|
+
lines.append(
|
|
606
|
+
"- backlog_hygiene_warning: "
|
|
607
|
+
f"requires_agent_todo={backlog_hygiene_warning.get('requires_agent_todo')} "
|
|
608
|
+
f"evidence_count={backlog_hygiene_warning.get('evidence_count')} "
|
|
609
|
+
f"source_sections={','.join(backlog_hygiene_warning.get('source_sections') or [])}"
|
|
610
|
+
)
|
|
611
|
+
if backlog_hygiene_warning.get("recommended_action"):
|
|
612
|
+
lines.append(f"- backlog_hygiene_action: {backlog_hygiene_warning.get('recommended_action')}")
|
|
613
|
+
projection_gap = as_dict(payload.get("state_projection_gap"))
|
|
614
|
+
if projection_gap:
|
|
615
|
+
lines.append(
|
|
616
|
+
"- state_projection_gap: "
|
|
617
|
+
f"requires_todo_expansion={projection_gap.get('requires_todo_expansion')} "
|
|
618
|
+
f"user_open={projection_gap.get('user_open_count')} "
|
|
619
|
+
f"agent_open={projection_gap.get('agent_open_count')} "
|
|
620
|
+
f"target_roles={','.join(projection_gap.get('target_roles') or [])}"
|
|
621
|
+
)
|
|
622
|
+
if projection_gap.get("recommended_action"):
|
|
623
|
+
lines.append(f"- state_projection_gap_action: {projection_gap.get('recommended_action')}")
|
|
624
|
+
_append_fallback_projection_markdown(
|
|
625
|
+
lines,
|
|
626
|
+
as_dict(payload.get("blocked_priority_fallback")),
|
|
627
|
+
label="blocked_priority",
|
|
628
|
+
blocked_items_key="blocked_items",
|
|
629
|
+
blocked_item_label="blocked_priority_item",
|
|
630
|
+
)
|
|
631
|
+
_append_fallback_projection_markdown(
|
|
632
|
+
lines,
|
|
633
|
+
as_dict(payload.get("scoped_user_gate_fallback")),
|
|
634
|
+
label="scoped_user_gate",
|
|
635
|
+
blocked_items_key="blocked_agent_items",
|
|
636
|
+
blocked_item_label="scoped_user_gate_blocked_item",
|
|
637
|
+
blocked_gate_key="blocked_user_gate",
|
|
638
|
+
)
|
|
639
|
+
completed_todo_archive_warning = as_dict(payload.get("completed_todo_archive_warning"))
|
|
640
|
+
if completed_todo_archive_warning:
|
|
641
|
+
lines.append(
|
|
642
|
+
"- completed_todo_archive_warning: "
|
|
643
|
+
f"requires_archive={completed_todo_archive_warning.get('requires_archive')} "
|
|
644
|
+
f"active_done={completed_todo_archive_warning.get('active_done_count')} "
|
|
645
|
+
f"max_active_done={completed_todo_archive_warning.get('max_active_done_count')} "
|
|
646
|
+
f"default_archive_keep={completed_todo_archive_warning.get('default_archive_keep_count')} "
|
|
647
|
+
f"archive_section={completed_todo_archive_warning.get('archive_section')} "
|
|
648
|
+
f"archive_command={completed_todo_archive_warning.get('archive_command_template')}"
|
|
649
|
+
)
|
|
650
|
+
if completed_todo_archive_warning.get("recommended_action"):
|
|
651
|
+
lines.append(
|
|
652
|
+
f"- completed_todo_archive_action: {completed_todo_archive_warning.get('recommended_action')}"
|
|
653
|
+
)
|
|
654
|
+
replan_obligation = as_dict(payload.get("autonomous_replan_obligation"))
|
|
655
|
+
if replan_obligation:
|
|
656
|
+
trigger_kinds = [
|
|
657
|
+
str(trigger.get("kind") or "")
|
|
658
|
+
for trigger in replan_obligation.get("triggers") or []
|
|
659
|
+
if isinstance(trigger, dict) and trigger.get("kind")
|
|
660
|
+
]
|
|
661
|
+
lines.append(
|
|
662
|
+
"- autonomous_replan_obligation: "
|
|
663
|
+
f"required={replan_obligation.get('required')} "
|
|
664
|
+
f"trigger_count={replan_obligation.get('trigger_count')} "
|
|
665
|
+
f"triggers={','.join(trigger_kinds)}"
|
|
666
|
+
)
|
|
667
|
+
required_reads = as_list(payload.get("required_reads"))
|
|
668
|
+
for read in required_reads[:3]:
|
|
669
|
+
if not isinstance(read, dict):
|
|
670
|
+
continue
|
|
671
|
+
command = str(read.get("command") or "").strip()
|
|
672
|
+
if command:
|
|
673
|
+
lines.append(
|
|
674
|
+
"- required_read: "
|
|
675
|
+
f"kind={read.get('kind')} "
|
|
676
|
+
f"agent_id={read.get('agent_id')} "
|
|
677
|
+
f"todo_id={read.get('todo_id') or ''} "
|
|
678
|
+
f"command=`{command}`"
|
|
679
|
+
)
|
|
680
|
+
work_lane_contract = as_dict(payload.get("work_lane_contract"))
|
|
681
|
+
if work_lane_contract:
|
|
682
|
+
lines.append(
|
|
683
|
+
"- work_lane_contract: "
|
|
684
|
+
f"lane={work_lane_contract.get('lane')} "
|
|
685
|
+
f"next={work_lane_contract.get('next_lane')} "
|
|
686
|
+
f"obligation={work_lane_contract.get('obligation')} "
|
|
687
|
+
f"must_attempt_work={work_lane_contract.get('must_attempt_work')}"
|
|
688
|
+
)
|
|
689
|
+
reason_codes = as_list(work_lane_contract.get("reason_codes"))
|
|
690
|
+
if reason_codes:
|
|
691
|
+
lines.append(f"- work_lane_reason_codes: {','.join(str(code) for code in reason_codes)}")
|
|
692
|
+
if work_lane_contract.get("monitor_policy"):
|
|
693
|
+
lines.append(f"- work_lane_monitor_policy: {work_lane_contract.get('monitor_policy')}")
|
|
694
|
+
if work_lane_contract.get("monitor_due_count"):
|
|
695
|
+
lines.append(
|
|
696
|
+
"- work_lane_monitor_due: "
|
|
697
|
+
f"count={work_lane_contract.get('monitor_due_count')} "
|
|
698
|
+
f"selected={work_lane_contract.get('selected_todo_id') or ''} "
|
|
699
|
+
f"next_due_at={work_lane_contract.get('selected_next_due_at') or ''}"
|
|
700
|
+
)
|
|
701
|
+
if work_lane_contract.get("lane") == "lark_event_inbox":
|
|
702
|
+
lines.append(
|
|
703
|
+
"- work_lane_lark_inbox: "
|
|
704
|
+
f"pending={work_lane_contract.get('pending_count')} "
|
|
705
|
+
f"questions={work_lane_contract.get('direct_question_count')} "
|
|
706
|
+
f"mentions={work_lane_contract.get('direct_mention_count')} "
|
|
707
|
+
f"bot_replies={work_lane_contract.get('reply_to_bot_count')} "
|
|
708
|
+
f"oldest_age_seconds={work_lane_contract.get('oldest_pending_age_seconds')}"
|
|
709
|
+
)
|
|
710
|
+
if work_lane_contract.get("action"):
|
|
711
|
+
lines.append(f"- work_lane_action: {work_lane_contract.get('action')}")
|
|
712
|
+
outcome_followthrough = as_dict(work_lane_contract.get("outcome_followthrough"))
|
|
713
|
+
if outcome_followthrough:
|
|
714
|
+
lines.append(
|
|
715
|
+
"- work_lane_outcome_followthrough: "
|
|
716
|
+
f"latest_outcome={outcome_followthrough.get('latest_delivery_outcome')} "
|
|
717
|
+
f"latest_kind={outcome_followthrough.get('latest_delivery_turn_kind')} "
|
|
718
|
+
f"obligation={outcome_followthrough.get('obligation')}"
|
|
719
|
+
)
|
|
720
|
+
interface_budget_cadence = as_dict(payload.get("interface_budget_cadence"))
|
|
721
|
+
if interface_budget_cadence:
|
|
722
|
+
lines.append(
|
|
723
|
+
"- interface_budget_cadence: "
|
|
724
|
+
f"overdue={interface_budget_cadence.get('overdue')} "
|
|
725
|
+
f"within_budget={interface_budget_cadence.get('within_budget')} "
|
|
726
|
+
f"checked_at={interface_budget_cadence.get('checked_at')} "
|
|
727
|
+
f"next_check_due_at={interface_budget_cadence.get('next_check_due_at')} "
|
|
728
|
+
f"tightest={interface_budget_cadence.get('tightest_surface')}/"
|
|
729
|
+
f"{interface_budget_cadence.get('tightest_metric')} "
|
|
730
|
+
f"headroom={interface_budget_cadence.get('headroom_remaining')} "
|
|
731
|
+
f"recommendation={interface_budget_cadence.get('recommendation')}"
|
|
732
|
+
)
|
|
733
|
+
execution_profile = as_dict(payload.get("execution_profile"))
|
|
734
|
+
if execution_profile:
|
|
735
|
+
lines.append(f"- execution_profile: {execution_profile_summary(execution_profile)}")
|
|
736
|
+
long_task_cadence_hint = as_dict(payload.get("long_task_cadence_hint"))
|
|
737
|
+
if long_task_cadence_hint:
|
|
738
|
+
lines.append(
|
|
739
|
+
f"- long_task_cadence_hint: {long_task_cadence_hint_summary(long_task_cadence_hint)}"
|
|
740
|
+
)
|
|
741
|
+
if control_plane := as_dict(payload.get("control_plane")):
|
|
742
|
+
lines.append(f"- control_plane: {control_plane_policy_summary(control_plane)}")
|
|
743
|
+
|
|
744
|
+
if quota:
|
|
745
|
+
lines.append(
|
|
746
|
+
"- quota: "
|
|
747
|
+
f"compute={quota.get('compute')} "
|
|
748
|
+
f"slot_minutes={quota.get('slot_minutes')} "
|
|
749
|
+
f"slots={quota.get('spent_slots')}/{quota.get('allowed_slots')}"
|
|
750
|
+
)
|
|
751
|
+
if payload.get("reason"):
|
|
752
|
+
lines.append(f"- reason: {payload.get('reason')}")
|
|
753
|
+
handoff_readiness = as_dict(payload.get("handoff_readiness"))
|
|
754
|
+
if handoff_readiness:
|
|
755
|
+
lines.append(
|
|
756
|
+
"- handoff_readiness: "
|
|
757
|
+
f"ready={handoff_readiness.get('ready')} "
|
|
758
|
+
f"codex_ready={handoff_readiness.get('codex_ready')} "
|
|
759
|
+
f"source={handoff_readiness.get('source')} "
|
|
760
|
+
f"quota_state={handoff_readiness.get('quota_state')}"
|
|
761
|
+
)
|
|
762
|
+
interface_budget = as_dict(handoff_readiness.get("handoff_interface_budget"))
|
|
763
|
+
if interface_budget:
|
|
764
|
+
lines.append(
|
|
765
|
+
"- handoff_interface_budget: "
|
|
766
|
+
f"mode={interface_budget.get('mode')} "
|
|
767
|
+
f"max_lines={interface_budget.get('max_lines')} "
|
|
768
|
+
f"max_chars={interface_budget.get('max_chars')}"
|
|
769
|
+
)
|
|
770
|
+
lines.append(
|
|
771
|
+
"- handoff_state: "
|
|
772
|
+
f"status={handoff_readiness.get('handoff_status')} "
|
|
773
|
+
f"post_handoff_run_seen={handoff_readiness.get('post_handoff_run_seen')} "
|
|
774
|
+
f"ready_at={handoff_readiness.get('handoff_ready_at') or ''}"
|
|
775
|
+
)
|
|
776
|
+
latest_handoff_run = as_dict(handoff_readiness.get("post_handoff_latest_run"))
|
|
777
|
+
if latest_handoff_run:
|
|
778
|
+
outcome_suffix = ""
|
|
779
|
+
if latest_handoff_run.get("delivery_outcome"):
|
|
780
|
+
outcome_suffix = f" outcome={latest_handoff_run.get('delivery_outcome')}"
|
|
781
|
+
lines.append(
|
|
782
|
+
"- post_handoff_run: "
|
|
783
|
+
f"classification={latest_handoff_run.get('classification')} "
|
|
784
|
+
f"at={latest_handoff_run.get('generated_at')} "
|
|
785
|
+
f"scale={latest_handoff_run.get('delivery_batch_scale') or ''}"
|
|
786
|
+
f"{outcome_suffix}"
|
|
787
|
+
)
|
|
788
|
+
recent_handoff_runs = as_list(handoff_readiness.get("post_handoff_recent_runs"))
|
|
789
|
+
recent_scales = [
|
|
790
|
+
str(run.get("delivery_batch_scale") or "")
|
|
791
|
+
for run in recent_handoff_runs
|
|
792
|
+
if isinstance(run, dict)
|
|
793
|
+
]
|
|
794
|
+
if recent_scales:
|
|
795
|
+
recent_outcomes = [
|
|
796
|
+
str(run.get("delivery_outcome") or "")
|
|
797
|
+
for run in recent_handoff_runs
|
|
798
|
+
if isinstance(run, dict) and run.get("delivery_outcome")
|
|
799
|
+
]
|
|
800
|
+
outcome_text = f" outcome={','.join(recent_outcomes)}" if recent_outcomes else ""
|
|
801
|
+
gap_text = (
|
|
802
|
+
f" outcome_gap_streak={handoff_readiness.get('post_handoff_outcome_gap_streak')}"
|
|
803
|
+
if "post_handoff_outcome_gap_streak" in handoff_readiness
|
|
804
|
+
else ""
|
|
805
|
+
)
|
|
806
|
+
lines.append(
|
|
807
|
+
"- post_handoff_recent_scales: "
|
|
808
|
+
f"{','.join(recent_scales)} "
|
|
809
|
+
f"small_streak={handoff_readiness.get('post_handoff_small_scale_streak', 0)}"
|
|
810
|
+
f"{outcome_text}"
|
|
811
|
+
f"{gap_text}"
|
|
812
|
+
)
|
|
813
|
+
heartbeat_recommendation = as_dict(payload.get("heartbeat_recommendation"))
|
|
814
|
+
if heartbeat_recommendation:
|
|
815
|
+
lines.append(
|
|
816
|
+
"- heartbeat_recommendation: "
|
|
817
|
+
f"mode={heartbeat_recommendation.get('recommended_mode')} "
|
|
818
|
+
f"notify={heartbeat_recommendation.get('notify')}"
|
|
819
|
+
)
|
|
820
|
+
if heartbeat_recommendation.get("command"):
|
|
821
|
+
lines.append(f"- heartbeat_command: `{heartbeat_recommendation.get('command')}`")
|
|
822
|
+
if heartbeat_recommendation.get("stop_if_unchanged"):
|
|
823
|
+
lines.append("- heartbeat_stop_if_unchanged: `True`")
|
|
824
|
+
if heartbeat_recommendation.get("repeat_notification_required"):
|
|
825
|
+
lines.append("- heartbeat_repeat_notification_required: `True`")
|
|
826
|
+
if heartbeat_recommendation.get("spend_policy"):
|
|
827
|
+
lines.append(f"- heartbeat_spend_policy: {heartbeat_recommendation.get('spend_policy')}")
|
|
828
|
+
if heartbeat_recommendation.get("reason"):
|
|
829
|
+
lines.append(f"- heartbeat_reason: {heartbeat_recommendation.get('reason')}")
|
|
830
|
+
execution_obligation = as_dict(payload.get("execution_obligation"))
|
|
831
|
+
if execution_obligation:
|
|
832
|
+
lines.append(
|
|
833
|
+
"- execution_obligation: "
|
|
834
|
+
f"must_attempt_work={execution_obligation.get('must_attempt_work')} "
|
|
835
|
+
f"kind={execution_obligation.get('kind')} "
|
|
836
|
+
f"notify_is_execution_gate={execution_obligation.get('notify_is_execution_gate')}"
|
|
837
|
+
)
|
|
838
|
+
if execution_obligation.get("contract_obligation"):
|
|
839
|
+
lines.append(f"- execution_contract_obligation: {execution_obligation.get('contract_obligation')}")
|
|
840
|
+
if execution_obligation.get("reason"):
|
|
841
|
+
lines.append(f"- execution_obligation_reason: {execution_obligation.get('reason')}")
|
|
842
|
+
interaction_contract = as_dict(payload.get("interaction_contract"))
|
|
843
|
+
if interaction_contract:
|
|
844
|
+
user_channel = as_dict(interaction_contract.get("user_channel"))
|
|
845
|
+
agent_channel = as_dict(interaction_contract.get("agent_channel"))
|
|
846
|
+
cli_channel = as_dict(interaction_contract.get("cli_channel"))
|
|
847
|
+
lines.append(
|
|
848
|
+
"- interaction_contract: "
|
|
849
|
+
f"schema={interaction_contract.get('schema_version')} "
|
|
850
|
+
f"mode={interaction_contract.get('mode')} "
|
|
851
|
+
f"user_required={user_channel.get('action_required')} "
|
|
852
|
+
f"agent_must_attempt={agent_channel.get('must_attempt')} "
|
|
853
|
+
f"quiet_noop_allowed={agent_channel.get('quiet_noop_allowed')} "
|
|
854
|
+
f"spend_after_validation={cli_channel.get('spend_after_validation')}"
|
|
855
|
+
)
|
|
856
|
+
if agent_channel.get("primary_action"):
|
|
857
|
+
lines.append(f"- interaction_agent_action: {agent_channel.get('primary_action')}")
|
|
858
|
+
if resolution_trace := as_dict(agent_channel.get("resolution_trace")):
|
|
859
|
+
lines.append(
|
|
860
|
+
f"- interaction_agent_resolution: {resolution_trace.get('summary')}"
|
|
861
|
+
)
|
|
862
|
+
automation_liveness = as_dict(payload.get("automation_liveness"))
|
|
863
|
+
if automation_liveness:
|
|
864
|
+
lines.append(
|
|
865
|
+
"- automation_liveness: "
|
|
866
|
+
f"action={automation_liveness.get('automation_action')} "
|
|
867
|
+
f"keep_active={automation_liveness.get('keep_active')} "
|
|
868
|
+
f"pause_allowed={automation_liveness.get('pause_allowed')}"
|
|
869
|
+
)
|
|
870
|
+
if automation_liveness.get("reason"):
|
|
871
|
+
lines.append(f"- automation_liveness_reason: {automation_liveness.get('reason')}")
|
|
872
|
+
if automation_liveness.get("pause_policy"):
|
|
873
|
+
lines.append(f"- automation_pause_policy: {automation_liveness.get('pause_policy')}")
|
|
874
|
+
scheduler_hint = as_dict(payload.get("scheduler_hint"))
|
|
875
|
+
if scheduler_hint:
|
|
876
|
+
codex_app = as_dict(scheduler_hint.get("codex_app"))
|
|
877
|
+
unchanged_poll = as_dict(scheduler_hint.get("unchanged_poll"))
|
|
878
|
+
limits = as_dict(unchanged_poll.get("limits"))
|
|
879
|
+
codex_cli_tui = as_dict(scheduler_hint.get("codex_cli_tui"))
|
|
880
|
+
claude_code_loop = as_dict(scheduler_hint.get("claude_code_loop"))
|
|
881
|
+
cli_unchanged_limit = (
|
|
882
|
+
limits.get("codex_cli_tui")
|
|
883
|
+
if "codex_cli_tui" in limits
|
|
884
|
+
else codex_cli_tui.get("unchanged_poll_limit")
|
|
885
|
+
)
|
|
886
|
+
claude_unchanged_limit = (
|
|
887
|
+
limits.get("claude_code_loop")
|
|
888
|
+
if "claude_code_loop" in limits
|
|
889
|
+
else claude_code_loop.get("unchanged_poll_limit")
|
|
890
|
+
)
|
|
891
|
+
lines.append(
|
|
892
|
+
"- scheduler_hint: "
|
|
893
|
+
f"action={scheduler_hint.get('action')} "
|
|
894
|
+
f"cadence={scheduler_hint.get('cadence_class')} "
|
|
895
|
+
f"codex_app_minutes={codex_app.get('recommended_interval_minutes')} "
|
|
896
|
+
f"codex_app_rrule={codex_app.get('recommended_rrule')} "
|
|
897
|
+
f"codex_app_apply_needed={(codex_app.get('stateful_backoff') or {}).get('apply_needed') if isinstance(codex_app.get('stateful_backoff'), dict) else None} "
|
|
898
|
+
f"codex_app_progression={codex_app.get('example_progression_minutes')} "
|
|
899
|
+
f"cli_unchanged_limit={cli_unchanged_limit} "
|
|
900
|
+
f"claude_unchanged_limit={claude_unchanged_limit}"
|
|
901
|
+
)
|
|
902
|
+
if scheduler_hint.get("reason"):
|
|
903
|
+
lines.append(f"- scheduler_hint_reason: {scheduler_hint.get('reason')}")
|
|
904
|
+
if reset_policy := as_dict(scheduler_hint.get("reset_policy")):
|
|
905
|
+
lines.append(
|
|
906
|
+
"- scheduler_reset: "
|
|
907
|
+
f"initial_interval={reset_policy.get('codex_app_initial_interval_minutes')} "
|
|
908
|
+
f"initial_rrule={reset_policy.get('codex_app_initial_rrule')} "
|
|
909
|
+
f"reset_generation={reset_policy.get('reset_token')} "
|
|
910
|
+
f"identity_signature={reset_policy.get('identity_signature')}"
|
|
911
|
+
)
|
|
912
|
+
protocol_action_packet = as_dict(payload.get("protocol_action_packet"))
|
|
913
|
+
if protocol_action_packet:
|
|
914
|
+
lines.append(
|
|
915
|
+
"- protocol_action_packet: "
|
|
916
|
+
f"schema={protocol_action_packet.get('schema_version')} "
|
|
917
|
+
f"{protocol_action_packet.get('summary') or ''}"
|
|
918
|
+
)
|
|
919
|
+
stall_self_repair = as_dict(payload.get("stall_self_repair"))
|
|
920
|
+
if stall_self_repair:
|
|
921
|
+
lines.append(
|
|
922
|
+
"- stall_self_repair: "
|
|
923
|
+
f"trigger={stall_self_repair.get('trigger')} "
|
|
924
|
+
f"mode={stall_self_repair.get('recommended_mode')} "
|
|
925
|
+
f"action={stall_self_repair.get('effective_action')}"
|
|
926
|
+
)
|
|
927
|
+
if stall_self_repair.get("repair_focus"):
|
|
928
|
+
lines.append(f"- stall_repair_focus: {stall_self_repair.get('repair_focus')}")
|
|
929
|
+
if stall_self_repair.get("missing_write_scopes"):
|
|
930
|
+
lines.append(
|
|
931
|
+
"- boundary_missing_write_scopes: "
|
|
932
|
+
f"{', '.join(str(value) for value in stall_self_repair.get('missing_write_scopes') or [])}"
|
|
933
|
+
)
|
|
934
|
+
blockers = as_list(stall_self_repair.get("blocking_health_items"))
|
|
935
|
+
for blocker in blockers[:3]:
|
|
936
|
+
if not isinstance(blocker, dict):
|
|
937
|
+
continue
|
|
938
|
+
lines.append(
|
|
939
|
+
"- stall_health_blocker: "
|
|
940
|
+
f"goal={blocker.get('goal_id')} "
|
|
941
|
+
f"status={blocker.get('status')} "
|
|
942
|
+
f"waiting_on={blocker.get('waiting_on')} "
|
|
943
|
+
f"action={blocker.get('recommended_action')}"
|
|
944
|
+
)
|
|
945
|
+
if payload.get("safe_bypass_allowed"):
|
|
946
|
+
lines.append(f"- safe_bypass_allowed: `{payload.get('safe_bypass_allowed')}`")
|
|
947
|
+
if payload.get("safe_bypass_kind"):
|
|
948
|
+
lines.append(f"- safe_bypass_kind: {payload.get('safe_bypass_kind')}")
|
|
949
|
+
if payload.get("blocked_action_scope"):
|
|
950
|
+
lines.append(f"- blocked_action_scope: `{payload.get('blocked_action_scope')}`")
|
|
951
|
+
if payload.get("safe_bypass_policy"):
|
|
952
|
+
lines.append(f"- safe_bypass_policy: {payload.get('safe_bypass_policy')}")
|
|
953
|
+
decision_freshness_warning = as_dict(payload.get("decision_freshness_warning"))
|
|
954
|
+
if decision_freshness_warning:
|
|
955
|
+
lines.append(
|
|
956
|
+
"- decision_freshness_warning: "
|
|
957
|
+
f"rebase_required={decision_freshness_warning.get('rebase_required_count')} "
|
|
958
|
+
f"window_days={decision_freshness_warning.get('window_days')} "
|
|
959
|
+
f"source={decision_freshness_warning.get('source')}"
|
|
960
|
+
)
|
|
961
|
+
if decision_freshness_warning.get("message"):
|
|
962
|
+
lines.append(f"- decision_freshness_action: {decision_freshness_warning.get('message')}")
|
|
963
|
+
freshness_items = as_list(decision_freshness_warning.get("items"))
|
|
964
|
+
for item in freshness_items[:DECISION_FRESHNESS_WARNING_ITEM_LIMIT]:
|
|
965
|
+
if not isinstance(item, dict):
|
|
966
|
+
continue
|
|
967
|
+
lines.append(
|
|
968
|
+
"- decision_freshness_item: "
|
|
969
|
+
f"kind={item.get('decision_kind')} "
|
|
970
|
+
f"state={item.get('freshness_state')} "
|
|
971
|
+
f"age_days={item.get('age_days')} "
|
|
972
|
+
f"newer_7d={item.get('newer_event_count_7d')} "
|
|
973
|
+
f"at={item.get('decision_at')}"
|
|
974
|
+
)
|
|
975
|
+
promotion_readiness_warning = as_dict(payload.get("promotion_readiness_warning"))
|
|
976
|
+
if promotion_readiness_warning:
|
|
977
|
+
lines.append(
|
|
978
|
+
"- promotion_readiness_warning: "
|
|
979
|
+
f"status={promotion_readiness_warning.get('freshness_status')} "
|
|
980
|
+
f"requires_readiness_run={promotion_readiness_warning.get('requires_readiness_run')} "
|
|
981
|
+
f"window_hours={promotion_readiness_warning.get('freshness_window_hours')} "
|
|
982
|
+
f"source={promotion_readiness_warning.get('source')}"
|
|
983
|
+
)
|
|
984
|
+
if promotion_readiness_warning.get("message"):
|
|
985
|
+
lines.append(f"- promotion_readiness_action: {promotion_readiness_warning.get('message')}")
|
|
986
|
+
lines.append(
|
|
987
|
+
"- promotion_readiness_evidence: "
|
|
988
|
+
f"goal={promotion_readiness_warning.get('goal_id') or ''} "
|
|
989
|
+
f"generated_at={promotion_readiness_warning.get('generated_at') or ''} "
|
|
990
|
+
f"age_hours={promotion_readiness_warning.get('age_hours')} "
|
|
991
|
+
f"artifacts={promotion_readiness_warning.get('json_exists')}/{promotion_readiness_warning.get('markdown_exists')}"
|
|
992
|
+
)
|
|
993
|
+
if promotion_readiness_warning.get("reason"):
|
|
994
|
+
lines.append(f"- promotion_readiness_reason: {promotion_readiness_warning.get('reason')}")
|
|
995
|
+
reward_lesson_warning = as_dict(payload.get("reward_lesson_projection_warning"))
|
|
996
|
+
if reward_lesson_warning:
|
|
997
|
+
lines.append(
|
|
998
|
+
"- reward_lesson_projection_warning: "
|
|
999
|
+
f"matches={reward_lesson_warning.get('match_count')} "
|
|
1000
|
+
f"source={reward_lesson_warning.get('source')}"
|
|
1001
|
+
)
|
|
1002
|
+
if reward_lesson_warning.get("message"):
|
|
1003
|
+
lines.append(f"- reward_lesson_action: {reward_lesson_warning.get('message')}")
|
|
1004
|
+
for match in (reward_lesson_warning.get("matches") or [])[:3]:
|
|
1005
|
+
if not isinstance(match, dict):
|
|
1006
|
+
continue
|
|
1007
|
+
lines.append(
|
|
1008
|
+
"- reward_lesson_match: "
|
|
1009
|
+
f"kind={match.get('kind')} "
|
|
1010
|
+
f"decision={match.get('decision')} "
|
|
1011
|
+
f"avoid={match.get('avoid')} "
|
|
1012
|
+
f"summary={match.get('summary')}"
|
|
1013
|
+
)
|
|
1014
|
+
goal_boundary = as_dict(payload.get("goal_boundary"))
|
|
1015
|
+
if goal_boundary:
|
|
1016
|
+
adapter = as_dict(goal_boundary.get("adapter"))
|
|
1017
|
+
if adapter:
|
|
1018
|
+
lines.append(
|
|
1019
|
+
"- goal_boundary_adapter: "
|
|
1020
|
+
f"{adapter.get('kind') or ''}:{adapter.get('status') or ''}"
|
|
1021
|
+
)
|
|
1022
|
+
write_scope = as_list(goal_boundary.get("write_scope"))
|
|
1023
|
+
if write_scope:
|
|
1024
|
+
lines.append(f"- goal_boundary_write_scope: {', '.join(str(value) for value in write_scope)}")
|
|
1025
|
+
approvals = as_list(goal_boundary.get("requires_parent_approval"))
|
|
1026
|
+
if approvals:
|
|
1027
|
+
lines.append(f"- goal_boundary_requires_approval: {', '.join(str(value) for value in approvals)}")
|
|
1028
|
+
guards = as_list(goal_boundary.get("guards"))
|
|
1029
|
+
for guard in guards[:5]:
|
|
1030
|
+
lines.append(f"- goal_boundary_guard: {guard}")
|
|
1031
|
+
orchestration = (
|
|
1032
|
+
goal_boundary.get("orchestration")
|
|
1033
|
+
if isinstance(goal_boundary.get("orchestration"), dict)
|
|
1034
|
+
else None
|
|
1035
|
+
)
|
|
1036
|
+
if orchestration:
|
|
1037
|
+
lines.append(f"- goal_boundary_orchestration: {orchestration_policy_summary(orchestration)}")
|
|
1038
|
+
capabilities = as_dict(goal_boundary.get("capabilities"))
|
|
1039
|
+
lark_inbox = as_dict(capabilities.get("lark_event_inbox"))
|
|
1040
|
+
urgency = as_dict(lark_inbox.get("urgency"))
|
|
1041
|
+
if urgency:
|
|
1042
|
+
lines.append(
|
|
1043
|
+
"- goal_boundary_lark_inbox_urgency: "
|
|
1044
|
+
f"pending={urgency.get('pending_count')} "
|
|
1045
|
+
f"questions={urgency.get('direct_question_count')} "
|
|
1046
|
+
f"mentions={urgency.get('direct_mention_count')} "
|
|
1047
|
+
f"bot_replies={urgency.get('reply_to_bot_count')} "
|
|
1048
|
+
f"reply_due={urgency.get('reply_due')} "
|
|
1049
|
+
f"oldest_age_seconds={urgency.get('oldest_pending_age_seconds')}"
|
|
1050
|
+
)
|
|
1051
|
+
run_permission_policy = (
|
|
1052
|
+
goal_boundary.get("run_permission_policy")
|
|
1053
|
+
if isinstance(goal_boundary.get("run_permission_policy"), dict)
|
|
1054
|
+
else None
|
|
1055
|
+
)
|
|
1056
|
+
if run_permission_policy:
|
|
1057
|
+
lines.append(
|
|
1058
|
+
"- goal_boundary_run_permission_policy: "
|
|
1059
|
+
f"valid={run_permission_policy.get('valid')} "
|
|
1060
|
+
f"delivery_allowed={run_permission_policy.get('delivery_allowed')} "
|
|
1061
|
+
f"no_upload={run_permission_policy.get('no_upload_required')} "
|
|
1062
|
+
f"compact_only={run_permission_policy.get('compact_observation_only')} "
|
|
1063
|
+
f"max_minutes={run_permission_policy.get('max_wall_time_minutes')}"
|
|
1064
|
+
)
|
|
1065
|
+
if goal_boundary.get("stop_condition"):
|
|
1066
|
+
lines.append(f"- goal_boundary_stop_condition: {goal_boundary.get('stop_condition')}")
|
|
1067
|
+
if payload.get("operator_question"):
|
|
1068
|
+
lines.append(f"- operator_question: {payload.get('operator_question')}")
|
|
1069
|
+
if payload.get("notify_user_on_gate"):
|
|
1070
|
+
lines.append(f"- notify_user_on_gate: `{payload.get('notify_user_on_gate')}`")
|
|
1071
|
+
if payload.get("notify_user_on_open_todo"):
|
|
1072
|
+
lines.append(f"- notify_user_on_open_todo: `{payload.get('notify_user_on_open_todo')}`")
|
|
1073
|
+
if payload.get("open_todo_notify_reason"):
|
|
1074
|
+
lines.append(f"- open_todo_notify_reason: {payload.get('open_todo_notify_reason')}")
|
|
1075
|
+
if payload.get("open_todo_notification_policy"):
|
|
1076
|
+
lines.append(f"- open_todo_notification_policy: {payload.get('open_todo_notification_policy')}")
|
|
1077
|
+
if payload.get("gate_prompt"):
|
|
1078
|
+
lines.extend(["", "## Gate Prompt", str(payload.get("gate_prompt"))])
|
|
1079
|
+
user_todo_summary = as_dict(payload.get("user_todo_summary"))
|
|
1080
|
+
if user_todo_summary:
|
|
1081
|
+
_append_todo_summary(lines, "user_todo", user_todo_summary)
|
|
1082
|
+
agent_todo_summary = as_dict(payload.get("agent_todo_summary"))
|
|
1083
|
+
selected_todo = as_dict(payload.get("selected_todo"))
|
|
1084
|
+
selected_todo_id = str(selected_todo.get("todo_id") or "").strip()
|
|
1085
|
+
lane_todo_id = str(agent_lane_next_action.get("todo_id") or "").strip()
|
|
1086
|
+
if selected_todo and (not selected_todo_id or selected_todo_id != lane_todo_id):
|
|
1087
|
+
lines.append(f"- selected_todo: {_compact_todo_identity(selected_todo)}")
|
|
1088
|
+
if agent_todo_summary:
|
|
1089
|
+
_append_todo_summary(lines, "agent_todo", agent_todo_summary)
|
|
1090
|
+
todo_write_hint = as_dict(payload.get("todo_write_hint"))
|
|
1091
|
+
if todo_write_hint:
|
|
1092
|
+
lines.append(f"- todo_write_hint: {todo_write_hint.get('rule')}")
|
|
1093
|
+
lines.append(f"- user_gate_command_template: `{todo_write_hint.get('user_gate_command_template')}`")
|
|
1094
|
+
lines.append(f"- user_action_command_template: `{todo_write_hint.get('user_action_command_template')}`")
|
|
1095
|
+
lines.append(f"- agent_todo_command_template: `{todo_write_hint.get('agent_todo_command_template')}`")
|
|
1096
|
+
if payload.get("recommended_action"):
|
|
1097
|
+
lines.append(f"- recommended_action: {payload.get('recommended_action')}")
|
|
1098
|
+
if payload.get("agent_command"):
|
|
1099
|
+
lines.append(f"- agent_command: `{payload.get('agent_command')}`")
|
|
1100
|
+
if payload.get("next_handoff_condition"):
|
|
1101
|
+
lines.append(f"- next_handoff_condition: {payload.get('next_handoff_condition')}")
|
|
1102
|
+
summary = as_dict(payload.get("plan_summary"))
|
|
1103
|
+
states = as_dict(summary.get("states"))
|
|
1104
|
+
if summary:
|
|
1105
|
+
state_text = ", ".join(f"{state}={states.get(state, 0)}" for state in QUOTA_STATE_ORDER)
|
|
1106
|
+
lines.append(
|
|
1107
|
+
"- plan_summary: "
|
|
1108
|
+
f"next_automatic_turn={summary.get('next_automatic_turn') or 'none'} "
|
|
1109
|
+
f"{state_text}"
|
|
1110
|
+
)
|
|
1111
|
+
append_operator_action_markdown(lines, payload)
|
|
1112
|
+
return "\n".join(lines)
|