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.
Files changed (811) hide show
  1. loopx/__init__.py +5 -0
  2. loopx/agent_onboarding.py +654 -0
  3. loopx/agent_registry.py +112 -0
  4. loopx/ark_managed_agent_host.py +59 -0
  5. loopx/authority.py +805 -0
  6. loopx/benchmark.py +2875 -0
  7. loopx/benchmark_adapters/__init__.py +1 -0
  8. loopx/benchmark_adapters/agentissue.py +2644 -0
  9. loopx/benchmark_adapters/agents_last_exam.py +3998 -0
  10. loopx/benchmark_adapters/edgebench.py +322 -0
  11. loopx/benchmark_adapters/skillsbench.py +5978 -0
  12. loopx/benchmark_adapters/skillsbench_acp_failure_policy.py +143 -0
  13. loopx/benchmark_adapters/skillsbench_acp_process.py +31 -0
  14. loopx/benchmark_adapters/skillsbench_acp_relay.py +4832 -0
  15. loopx/benchmark_adapters/skillsbench_batch.py +124 -0
  16. loopx/benchmark_adapters/skillsbench_bridge_guard.py +209 -0
  17. loopx/benchmark_adapters/skillsbench_bridge_summary.py +203 -0
  18. loopx/benchmark_adapters/skillsbench_codex_goal_recovery.py +271 -0
  19. loopx/benchmark_adapters/skillsbench_codex_goal_trace.py +81 -0
  20. loopx/benchmark_adapters/skillsbench_codex_runtime.py +339 -0
  21. loopx/benchmark_adapters/skillsbench_dockerfile_runtime.py +467 -0
  22. loopx/benchmark_adapters/skillsbench_failure_signals.py +652 -0
  23. loopx/benchmark_adapters/skillsbench_proxy_runtime.py +327 -0
  24. loopx/benchmark_adapters/skillsbench_remote_bridge.py +402 -0
  25. loopx/benchmark_adapters/skillsbench_result_discovery.py +143 -0
  26. loopx/benchmark_adapters/skillsbench_runner_profile.py +436 -0
  27. loopx/benchmark_adapters/skillsbench_runner_source.py +99 -0
  28. loopx/benchmark_adapters/skillsbench_setup_preflight.py +771 -0
  29. loopx/benchmark_adapters/skillsbench_signals.py +15 -0
  30. loopx/benchmark_adapters/skillsbench_task_source.py +141 -0
  31. loopx/benchmark_adapters/skillsbench_turn_route.py +723 -0
  32. loopx/benchmark_adapters/skillsbench_turn_runtime.py +1069 -0
  33. loopx/benchmark_adapters/skillsbench_typed_repair.py +689 -0
  34. loopx/benchmark_adapters/skillsbench_uv_cache.py +111 -0
  35. loopx/benchmark_adapters/skillsbench_verifier_bootstrap.py +227 -0
  36. loopx/benchmark_adapters/skillsbench_verifier_cache.py +138 -0
  37. loopx/benchmark_adapters/terminal_bench.py +10078 -0
  38. loopx/benchmark_case_analysis.py +1276 -0
  39. loopx/benchmark_case_state.py +1079 -0
  40. loopx/benchmark_core/__init__.py +239 -0
  41. loopx/benchmark_core/adapter.py +84 -0
  42. loopx/benchmark_core/artifacts.py +517 -0
  43. loopx/benchmark_core/attempts.py +199 -0
  44. loopx/benchmark_core/container_exec.py +216 -0
  45. loopx/benchmark_core/io.py +68 -0
  46. loopx/benchmark_core/lifecycle.py +211 -0
  47. loopx/benchmark_core/loop_protocol.py +689 -0
  48. loopx/benchmark_core/observable_handles.py +348 -0
  49. loopx/benchmark_core/parity.py +256 -0
  50. loopx/benchmark_core/remote_closeout.py +482 -0
  51. loopx/benchmark_core/rounds.py +215 -0
  52. loopx/benchmark_core/route_profile.py +509 -0
  53. loopx/benchmark_core/run_permissions.py +206 -0
  54. loopx/benchmark_core/split_control.py +925 -0
  55. loopx/benchmark_core/turn_fidelity.py +326 -0
  56. loopx/benchmark_ledger.py +3793 -0
  57. loopx/benchmark_ledger_countability.py +372 -0
  58. loopx/benchmark_ledger_current.py +724 -0
  59. loopx/benchmark_trajectory.py +405 -0
  60. loopx/benchmarks/__init__.py +1 -0
  61. loopx/benchmarks/qualification/__init__.py +1 -0
  62. loopx/benchmarks/qualification/release_outcome_baseline.py +360 -0
  63. loopx/benchmarks/read_models/__init__.py +1 -0
  64. loopx/benchmarks/read_models/benchmark_attempt_accounting.py +53 -0
  65. loopx/benchmarks/read_models/benchmark_comparison.py +414 -0
  66. loopx/benchmarks/read_models/benchmark_event_timeline.py +113 -0
  67. loopx/benchmarks/read_models/benchmark_experiment_report.py +475 -0
  68. loopx/benchmarks/read_models/benchmark_learning_ledger.py +137 -0
  69. loopx/benchmarks/read_models/benchmark_lifecycle_contracts.py +228 -0
  70. loopx/benchmarks/read_models/benchmark_projection.py +723 -0
  71. loopx/benchmarks/read_models/benchmark_result.py +146 -0
  72. loopx/benchmarks/read_models/benchmark_run_execution_contract.py +116 -0
  73. loopx/benchmarks/read_models/benchmark_run_failure.py +157 -0
  74. loopx/benchmarks/read_models/benchmark_run_metrics.py +213 -0
  75. loopx/benchmarks/read_models/benchmark_run_post_execution.py +635 -0
  76. loopx/benchmarks/read_models/benchmark_run_pre_execution.py +541 -0
  77. loopx/benchmarks/read_models/benchmark_status_compaction.py +1255 -0
  78. loopx/benchmarks/read_models/benchmark_status_runner.py +780 -0
  79. loopx/benchmarks/read_models/goal_start_control_score.py +857 -0
  80. loopx/benchmarks/read_models/skillsbench_post_run_debug.py +746 -0
  81. loopx/benchmarks/read_models/skillsbench_verifier_attribution.py +269 -0
  82. loopx/bootstrap.py +1116 -0
  83. loopx/bootstrap_command_pack.py +2167 -0
  84. loopx/boundary_authority.py +199 -0
  85. loopx/canary/__init__.py +1 -0
  86. loopx/canary/maintainability_ratchet.py +800 -0
  87. loopx/canary/planner.py +1984 -0
  88. loopx/canary/premerge.py +1130 -0
  89. loopx/canary/qualification_profiles.py +309 -0
  90. loopx/canary/quality_surface_catalog.py +838 -0
  91. loopx/canary/release_profiles.py +51 -0
  92. loopx/canary/runner.py +1107 -0
  93. loopx/canary/smoke_health.py +581 -0
  94. loopx/canary/smoke_profiles.py +212 -0
  95. loopx/capabilities/__init__.py +0 -0
  96. loopx/capabilities/agent_turn_recall/__init__.py +17 -0
  97. loopx/capabilities/agent_turn_recall/cli.py +369 -0
  98. loopx/capabilities/agent_turn_recall/core.py +296 -0
  99. loopx/capabilities/auto_research/__init__.py +16 -0
  100. loopx/capabilities/auto_research/bootstrap_contract.py +157 -0
  101. loopx/capabilities/auto_research/cli.py +1468 -0
  102. loopx/capabilities/auto_research/core.py +11 -0
  103. loopx/capabilities/auto_research/defaults.py +79 -0
  104. loopx/capabilities/auto_research/demo_e2e.py +1848 -0
  105. loopx/capabilities/auto_research/demo_supervisor.py +186 -0
  106. loopx/capabilities/auto_research/evidence_packet.py +767 -0
  107. loopx/capabilities/auto_research/human_view.py +794 -0
  108. loopx/capabilities/auto_research/kernel.py +191 -0
  109. loopx/capabilities/auto_research/knn_demo_workspace.py +322 -0
  110. loopx/capabilities/auto_research/live_evidence.py +248 -0
  111. loopx/capabilities/auto_research/preset.py +176 -0
  112. loopx/capabilities/auto_research/research_state.py +1085 -0
  113. loopx/capabilities/auto_research/role_profiles.py +394 -0
  114. loopx/capabilities/auto_research/rollout_append.py +97 -0
  115. loopx/capabilities/auto_research/terminal_result_contract.py +422 -0
  116. loopx/capabilities/auto_research/terminal_result_projection.py +171 -0
  117. loopx/capabilities/auto_research/terminal_result_query.py +233 -0
  118. loopx/capabilities/auto_research/terminal_results.py +349 -0
  119. loopx/capabilities/auto_research/user_contract.py +190 -0
  120. loopx/capabilities/auto_research/worker_loop.py +163 -0
  121. loopx/capabilities/auto_research/worker_runtime.py +777 -0
  122. loopx/capabilities/auto_research/worker_skill/SKILL.md +343 -0
  123. loopx/capabilities/benchmark_toolkit/__init__.py +19 -0
  124. loopx/capabilities/benchmark_toolkit/integrity.py +387 -0
  125. loopx/capabilities/catalog.py +1875 -0
  126. loopx/capabilities/change_quality/__init__.py +19 -0
  127. loopx/capabilities/change_quality/cli.py +171 -0
  128. loopx/capabilities/change_quality/context.py +156 -0
  129. loopx/capabilities/change_quality/oracles.py +269 -0
  130. loopx/capabilities/change_quality/policy.py +34 -0
  131. loopx/capabilities/change_quality/receipt.py +482 -0
  132. loopx/capabilities/change_quality/result.py +493 -0
  133. loopx/capabilities/change_quality/scope.py +171 -0
  134. loopx/capabilities/change_quality/shadow.py +680 -0
  135. loopx/capabilities/content_ops/__init__.py +0 -0
  136. loopx/capabilities/content_ops/cli.py +649 -0
  137. loopx/capabilities/content_ops/connector_packets.py +164 -0
  138. loopx/capabilities/content_ops/item_lifecycle.py +1000 -0
  139. loopx/capabilities/content_ops/layout.py +451 -0
  140. loopx/capabilities/content_ops/markdown.py +456 -0
  141. loopx/capabilities/content_ops/schemas.py +51 -0
  142. loopx/capabilities/content_ops/social_browser_x.py +107 -0
  143. loopx/capabilities/content_ops/surface.py +1956 -0
  144. loopx/capabilities/content_ops/templates/layout-catalog-v0.json +72 -0
  145. loopx/capabilities/context_providers/__init__.py +36 -0
  146. loopx/capabilities/context_providers/base.py +189 -0
  147. loopx/capabilities/context_providers/factory.py +32 -0
  148. loopx/capabilities/context_providers/openviking.py +702 -0
  149. loopx/capabilities/context_providers/service_ownership.py +185 -0
  150. loopx/capabilities/decision_context/__init__.py +129 -0
  151. loopx/capabilities/decision_context/architecture.py +83 -0
  152. loopx/capabilities/decision_context/assembler.py +849 -0
  153. loopx/capabilities/decision_context/catalog_entry.py +195 -0
  154. loopx/capabilities/decision_context/cli.py +310 -0
  155. loopx/capabilities/decision_context/cursor_commit.py +535 -0
  156. loopx/capabilities/decision_context/outcome_feedback.py +352 -0
  157. loopx/capabilities/decision_context/packets.py +654 -0
  158. loopx/capabilities/decision_context/private_state.py +189 -0
  159. loopx/capabilities/decision_context/profile.py +453 -0
  160. loopx/capabilities/decision_context/providers.py +228 -0
  161. loopx/capabilities/decision_context/review_settlement.py +136 -0
  162. loopx/capabilities/decision_context/runtime.py +273 -0
  163. loopx/capabilities/decision_context/sources.py +415 -0
  164. loopx/capabilities/explore/__init__.py +1 -0
  165. loopx/capabilities/explore/activation.py +198 -0
  166. loopx/capabilities/explore/adaptive_replay_planner.py +221 -0
  167. loopx/capabilities/explore/child_replay_runtime.py +463 -0
  168. loopx/capabilities/explore/composition_frontier.py +291 -0
  169. loopx/capabilities/explore/counterfactual_runtime.py +578 -0
  170. loopx/capabilities/explore/episode_runtime.py +647 -0
  171. loopx/capabilities/explore/harness_checkpoint.py +171 -0
  172. loopx/capabilities/explore/harness_gate.py +115 -0
  173. loopx/capabilities/explore/harness_runtime.py +1124 -0
  174. loopx/capabilities/explore/replay_metrics.py +206 -0
  175. loopx/capabilities/explore/replay_runtime.py +1271 -0
  176. loopx/capabilities/explore/resource_portfolio.py +173 -0
  177. loopx/capabilities/explore/result_log.py +974 -0
  178. loopx/capabilities/explore/router_state.py +432 -0
  179. loopx/capabilities/explore/source_history_reconcile.py +255 -0
  180. loopx/capabilities/explore/speculative_scheduler.py +498 -0
  181. loopx/capabilities/explore/todo_branch_plan.py +650 -0
  182. loopx/capabilities/explore/todo_evidence.py +141 -0
  183. loopx/capabilities/explore/trace_runtime.py +284 -0
  184. loopx/capabilities/explore/worker_branch_plan.py +1257 -0
  185. loopx/capabilities/integration_branch/__init__.py +13 -0
  186. loopx/capabilities/integration_branch/cli.py +148 -0
  187. loopx/capabilities/integration_branch/core.py +916 -0
  188. loopx/capabilities/issue_fix/__init__.py +19 -0
  189. loopx/capabilities/issue_fix/acceptance_loop.py +1050 -0
  190. loopx/capabilities/issue_fix/candidate_evidence.py +503 -0
  191. loopx/capabilities/issue_fix/candidate_preflight.py +676 -0
  192. loopx/capabilities/issue_fix/cli.py +1822 -0
  193. loopx/capabilities/issue_fix/cli_input.py +87 -0
  194. loopx/capabilities/issue_fix/content_ops_cli.py +148 -0
  195. loopx/capabilities/issue_fix/discovered_issue_promotion.py +947 -0
  196. loopx/capabilities/issue_fix/explore_projection.py +710 -0
  197. loopx/capabilities/issue_fix/feasibility.py +542 -0
  198. loopx/capabilities/issue_fix/github_public.py +661 -0
  199. loopx/capabilities/issue_fix/intake_surface.py +832 -0
  200. loopx/capabilities/issue_fix/metadata_preview.py +218 -0
  201. loopx/capabilities/issue_fix/metrics_projection.py +1340 -0
  202. loopx/capabilities/issue_fix/metrics_supplement.py +634 -0
  203. loopx/capabilities/issue_fix/metrics_supplement_cli.py +127 -0
  204. loopx/capabilities/issue_fix/outcome_projection.py +1235 -0
  205. loopx/capabilities/issue_fix/periodic_report.py +189 -0
  206. loopx/capabilities/issue_fix/pr_description.py +418 -0
  207. loopx/capabilities/issue_fix/pr_gate_reconcile.py +496 -0
  208. loopx/capabilities/issue_fix/pr_gate_reconcile_cli.py +464 -0
  209. loopx/capabilities/issue_fix/pr_lifecycle.py +1327 -0
  210. loopx/capabilities/issue_fix/pr_lifecycle_rollout.py +85 -0
  211. loopx/capabilities/issue_fix/pr_monitor_materialization.py +257 -0
  212. loopx/capabilities/issue_fix/pr_review_ack.py +439 -0
  213. loopx/capabilities/issue_fix/provider_hooks.py +24 -0
  214. loopx/capabilities/issue_fix/repository_commit_evidence.py +186 -0
  215. loopx/capabilities/issue_fix/repository_context.py +457 -0
  216. loopx/capabilities/issue_fix/repository_memory.py +459 -0
  217. loopx/capabilities/issue_fix/repository_memory_provider.py +1454 -0
  218. loopx/capabilities/issue_fix/repository_snapshot.py +454 -0
  219. loopx/capabilities/issue_fix/reviewer_cli.py +917 -0
  220. loopx/capabilities/issue_fix/reviewer_notification.py +882 -0
  221. loopx/capabilities/issue_fix/reviewer_notification_drain.py +942 -0
  222. loopx/capabilities/issue_fix/reviewer_recommendation.py +1057 -0
  223. loopx/capabilities/issue_fix/reviewer_request.py +1282 -0
  224. loopx/capabilities/issue_fix/reward_memory.py +879 -0
  225. loopx/capabilities/issue_fix/workflow_plan.py +1286 -0
  226. loopx/capabilities/material_lifecycle/__init__.py +161 -0
  227. loopx/capabilities/material_lifecycle/_validation.py +183 -0
  228. loopx/capabilities/material_lifecycle/apply.py +672 -0
  229. loopx/capabilities/material_lifecycle/architecture.py +122 -0
  230. loopx/capabilities/material_lifecycle/cli.py +161 -0
  231. loopx/capabilities/material_lifecycle/decision_planning.py +470 -0
  232. loopx/capabilities/material_lifecycle/explore_execution.py +306 -0
  233. loopx/capabilities/material_lifecycle/intake.py +869 -0
  234. loopx/capabilities/material_lifecycle/inventory.py +147 -0
  235. loopx/capabilities/material_lifecycle/lifecycle.py +98 -0
  236. loopx/capabilities/material_lifecycle/preparation.py +147 -0
  237. loopx/capabilities/material_lifecycle/project_skill.py +83 -0
  238. loopx/capabilities/material_lifecycle/ranking.py +267 -0
  239. loopx/capabilities/material_lifecycle/readable_projection.py +500 -0
  240. loopx/capabilities/material_lifecycle/rebuild.py +480 -0
  241. loopx/capabilities/material_lifecycle/settlement.py +238 -0
  242. loopx/capabilities/periodic_report/__init__.py +71 -0
  243. loopx/capabilities/periodic_report/adapters.py +939 -0
  244. loopx/capabilities/periodic_report/archive.py +422 -0
  245. loopx/capabilities/periodic_report/bindings.py +705 -0
  246. loopx/capabilities/periodic_report/cli.py +277 -0
  247. loopx/capabilities/periodic_report/core.py +691 -0
  248. loopx/capabilities/periodic_report/extension_envelope.py +66 -0
  249. loopx/capabilities/periodic_report/presets.py +103 -0
  250. loopx/capabilities/periodic_report/profile.py +235 -0
  251. loopx/capabilities/periodic_report/project_progress.py +179 -0
  252. loopx/capabilities/periodic_report/triggers.py +452 -0
  253. loopx/capabilities/pr_review_queue/__init__.py +17 -0
  254. loopx/capabilities/pr_review_queue/core.py +506 -0
  255. loopx/capabilities/pr_review_queue/review_contract.py +506 -0
  256. loopx/capabilities/registry.py +192 -0
  257. loopx/capabilities/reward_memory/__init__.py +75 -0
  258. loopx/capabilities/reward_memory/application.py +819 -0
  259. loopx/capabilities/reward_memory/architecture.py +572 -0
  260. loopx/capabilities/reward_memory/candidate_review.py +511 -0
  261. loopx/capabilities/reward_memory/cli.py +469 -0
  262. loopx/capabilities/reward_memory/dogfood.py +574 -0
  263. loopx/capabilities/reward_memory/evaluation.py +296 -0
  264. loopx/capabilities/reward_memory/evaluation_fixtures.py +362 -0
  265. loopx/capabilities/reward_memory/experiment.py +567 -0
  266. loopx/capabilities/reward_memory/health.py +222 -0
  267. loopx/capabilities/reward_memory/ingestion.py +519 -0
  268. loopx/capabilities/reward_memory/registry.py +600 -0
  269. loopx/capabilities/reward_memory/runtime_hooks.py +312 -0
  270. loopx/capabilities/reward_memory/scoped_feedback.py +173 -0
  271. loopx/capabilities/semantic_preference/__init__.py +12 -0
  272. loopx/capabilities/semantic_preference/cli.py +189 -0
  273. loopx/capabilities/semantic_preference/contract.py +592 -0
  274. loopx/capabilities/semantic_preference/reward_memory.py +62 -0
  275. loopx/capabilities/value_connectors/__init__.py +1 -0
  276. loopx/capabilities/value_connectors/cli.py +401 -0
  277. loopx/capabilities/value_connectors/finance_extension_migration.py +108 -0
  278. loopx/capabilities/value_connectors/install_check.py +147 -0
  279. loopx/capabilities/value_connectors/planner.py +733 -0
  280. loopx/capabilities/value_connectors/source_map.py +446 -0
  281. loopx/claude_goal_baseline.py +138 -0
  282. loopx/claude_goal_mode/__init__.py +23 -0
  283. loopx/claude_goal_mode/hooks/goal_policy.py +212 -0
  284. loopx/claude_goal_mode/hooks/goal_state.py +139 -0
  285. loopx/claude_goal_mode/mcp/loopx_mcp.py +167 -0
  286. loopx/claude_goal_mode/scripts/connect.py +103 -0
  287. loopx/claude_goal_mode/scripts/goalmode_cmd.py +241 -0
  288. loopx/claude_goal_mode/scripts/install.py +328 -0
  289. loopx/claude_goal_mode/statusline/goal_status.py +97 -0
  290. loopx/cli.py +836 -0
  291. loopx/cli_commands/__init__.py +334 -0
  292. loopx/cli_commands/_host_thread.py +13 -0
  293. loopx/cli_commands/agentissue_runner_flow.py +447 -0
  294. loopx/cli_commands/agents_last_exam.py +160 -0
  295. loopx/cli_commands/agents_last_exam_baked_input.py +302 -0
  296. loopx/cli_commands/agents_last_exam_host_codex.py +374 -0
  297. loopx/cli_commands/agents_last_exam_launch_dry_run.py +372 -0
  298. loopx/cli_commands/agents_last_exam_local_plan.py +322 -0
  299. loopx/cli_commands/agents_last_exam_runner_source.py +352 -0
  300. loopx/cli_commands/agents_last_exam_task_material.py +335 -0
  301. loopx/cli_commands/agents_last_exam_validation_gate.py +236 -0
  302. loopx/cli_commands/benchmark_boundary.py +499 -0
  303. loopx/cli_commands/benchmark_dispatch.py +161 -0
  304. loopx/cli_commands/benchmark_release_outcome.py +123 -0
  305. loopx/cli_commands/benchmark_review_lifecycle.py +1275 -0
  306. loopx/cli_commands/benchmark_run_ledger.py +763 -0
  307. loopx/cli_commands/benchmark_run_ledger_case_analysis.py +249 -0
  308. loopx/cli_commands/benchmark_run_ledger_classification.py +45 -0
  309. loopx/cli_commands/benchmark_run_ledger_maintenance.py +486 -0
  310. loopx/cli_commands/benchmark_run_ledger_maintenance_registration.py +342 -0
  311. loopx/cli_commands/benchmark_run_ledger_maintenance_rendering.py +233 -0
  312. loopx/cli_commands/benchmark_run_ledger_parity.py +92 -0
  313. loopx/cli_commands/bootstrap_connect.py +238 -0
  314. loopx/cli_commands/canary.py +707 -0
  315. loopx/cli_commands/canary_release_qualification.py +79 -0
  316. loopx/cli_commands/capability.py +96 -0
  317. loopx/cli_commands/doctor.py +43 -0
  318. loopx/cli_commands/dreaming.py +143 -0
  319. loopx/cli_commands/edgebench.py +205 -0
  320. loopx/cli_commands/evidence_log.py +275 -0
  321. loopx/cli_commands/explore.py +989 -0
  322. loopx/cli_commands/explore_planning_commands.py +157 -0
  323. loopx/cli_commands/extension.py +271 -0
  324. loopx/cli_commands/first_run_report.py +73 -0
  325. loopx/cli_commands/goal_channel.py +656 -0
  326. loopx/cli_commands/handoff_mode.py +158 -0
  327. loopx/cli_commands/history.py +622 -0
  328. loopx/cli_commands/host_mode_plan.py +113 -0
  329. loopx/cli_commands/lark_inbox.py +431 -0
  330. loopx/cli_commands/lark_kanban.py +629 -0
  331. loopx/cli_commands/ml_experiment.py +321 -0
  332. loopx/cli_commands/multi_agent.py +211 -0
  333. loopx/cli_commands/opencode2_goal_worker.py +217 -0
  334. loopx/cli_commands/pr_review.py +167 -0
  335. loopx/cli_commands/presentation.py +218 -0
  336. loopx/cli_commands/preset.py +96 -0
  337. loopx/cli_commands/project.py +150 -0
  338. loopx/cli_commands/project_lifecycle.py +915 -0
  339. loopx/cli_commands/quota.py +859 -0
  340. loopx/cli_commands/quota_registration.py +241 -0
  341. loopx/cli_commands/quota_request.py +113 -0
  342. loopx/cli_commands/ready_score.py +110 -0
  343. loopx/cli_commands/registry_admin.py +975 -0
  344. loopx/cli_commands/registry_admin_configure.py +344 -0
  345. loopx/cli_commands/registry_admin_peer.py +84 -0
  346. loopx/cli_commands/registry_authority.py +218 -0
  347. loopx/cli_commands/review_batch.py +146 -0
  348. loopx/cli_commands/slash_commands.py +145 -0
  349. loopx/cli_commands/start_goal.py +251 -0
  350. loopx/cli_commands/starter.py +175 -0
  351. loopx/cli_commands/starter_bootstrap.py +179 -0
  352. loopx/cli_commands/starter_bootstrap_registration.py +198 -0
  353. loopx/cli_commands/starter_runtime_idle.py +107 -0
  354. loopx/cli_commands/starter_scheduler.py +207 -0
  355. loopx/cli_commands/starter_session_runtime.py +152 -0
  356. loopx/cli_commands/starter_visible_common.py +54 -0
  357. loopx/cli_commands/starter_visible_driver.py +161 -0
  358. loopx/cli_commands/starter_visible_pilot.py +278 -0
  359. loopx/cli_commands/status.py +867 -0
  360. loopx/cli_commands/status_registration.py +239 -0
  361. loopx/cli_commands/summary_all.py +222 -0
  362. loopx/cli_commands/support_control.py +809 -0
  363. loopx/cli_commands/support_control_registry.py +68 -0
  364. loopx/cli_commands/support_control_supervisor.py +289 -0
  365. loopx/cli_commands/task_lease.py +306 -0
  366. loopx/cli_commands/terminal_bench_adapter.py +717 -0
  367. loopx/cli_commands/terminal_bench_environment_result.py +1246 -0
  368. loopx/cli_commands/todo.py +940 -0
  369. loopx/cli_commands/todo_argument_validation.py +572 -0
  370. loopx/cli_commands/todo_event.py +114 -0
  371. loopx/cli_commands/turn.py +804 -0
  372. loopx/cli_commands/version.py +46 -0
  373. loopx/cli_commands/worker_bridge.py +659 -0
  374. loopx/cli_rollout.py +314 -0
  375. loopx/codex_cli_goal_tui.py +672 -0
  376. loopx/codex_cli_probe.py +1530 -0
  377. loopx/codex_cli_probe_markdown.py +935 -0
  378. loopx/codex_cli_runtime_probe.py +733 -0
  379. loopx/codex_cli_scheduler.py +564 -0
  380. loopx/codex_goal_baseline.py +620 -0
  381. loopx/configuration_catalog.py +617 -0
  382. loopx/configure_goal.py +1375 -0
  383. loopx/contract.py +996 -0
  384. loopx/control_plane/__init__.py +71 -0
  385. loopx/control_plane/agents/__init__.py +1 -0
  386. loopx/control_plane/agents/agent_lane_recommendation.py +516 -0
  387. loopx/control_plane/agents/agent_scope.py +1578 -0
  388. loopx/control_plane/agents/agent_scope_frontier.py +60 -0
  389. loopx/control_plane/agents/capability_gate.py +531 -0
  390. loopx/control_plane/agents/identity.py +140 -0
  391. loopx/control_plane/agents/legacy_migration.py +169 -0
  392. loopx/control_plane/agents/management_projection.py +658 -0
  393. loopx/control_plane/agents/material_frontier.py +608 -0
  394. loopx/control_plane/agents/material_handoff.py +156 -0
  395. loopx/control_plane/agents/multi_agent/__init__.py +1 -0
  396. loopx/control_plane/agents/multi_agent/codex_executable.py +207 -0
  397. loopx/control_plane/agents/multi_agent/collective_round_ledger.py +387 -0
  398. loopx/control_plane/agents/multi_agent/contract.py +474 -0
  399. loopx/control_plane/agents/multi_agent/recipe.py +110 -0
  400. loopx/control_plane/agents/multi_agent/role_successor.py +297 -0
  401. loopx/control_plane/agents/multi_agent/runtime_scripts.py +426 -0
  402. loopx/control_plane/agents/multi_agent/visible_launch_policy.py +149 -0
  403. loopx/control_plane/agents/multi_agent/visible_wake_scheduler.py +392 -0
  404. loopx/control_plane/agents/profile.py +216 -0
  405. loopx/control_plane/agents/runtime_model.py +73 -0
  406. loopx/control_plane/agents/subagent_activity.py +164 -0
  407. loopx/control_plane/agents/supervisor.py +544 -0
  408. loopx/control_plane/agents/supervisor_events.py +462 -0
  409. loopx/control_plane/agents/supervisor_inject.py +204 -0
  410. loopx/control_plane/agents/work_mode.py +56 -0
  411. loopx/control_plane/agents/workspace_guard.py +364 -0
  412. loopx/control_plane/effect_program.py +644 -0
  413. loopx/control_plane/goals/__init__.py +1 -0
  414. loopx/control_plane/goals/active_state_event_projection.py +103 -0
  415. loopx/control_plane/goals/active_state_metadata.py +47 -0
  416. loopx/control_plane/goals/active_state_sections.py +58 -0
  417. loopx/control_plane/goals/configure_goal_service.py +354 -0
  418. loopx/control_plane/goals/contract_health.py +132 -0
  419. loopx/control_plane/goals/dreaming.py +152 -0
  420. loopx/control_plane/goals/global_registry_health.py +199 -0
  421. loopx/control_plane/goals/global_registry_shadow.py +33 -0
  422. loopx/control_plane/goals/goal_channel.py +34 -0
  423. loopx/control_plane/goals/goal_channel_projection.py +560 -0
  424. loopx/control_plane/goals/goal_frontier/__init__.py +1917 -0
  425. loopx/control_plane/goals/goal_frontier/ack_policy.py +149 -0
  426. loopx/control_plane/goals/goal_frontier/outcome_continuity.py +437 -0
  427. loopx/control_plane/goals/goal_frontier/replan_rules.py +210 -0
  428. loopx/control_plane/goals/goal_frontier/semantic_history.py +314 -0
  429. loopx/control_plane/goals/goal_frontier/terminal.py +180 -0
  430. loopx/control_plane/goals/goal_vision.py +443 -0
  431. loopx/control_plane/goals/goal_vision_policy.py +36 -0
  432. loopx/control_plane/goals/goal_vision_state.py +62 -0
  433. loopx/control_plane/goals/goal_vision_wait.py +290 -0
  434. loopx/control_plane/goals/path_resolution.py +20 -0
  435. loopx/control_plane/goals/start_contract.py +206 -0
  436. loopx/control_plane/goals/vision_checkpoint.py +92 -0
  437. loopx/control_plane/handoff/__init__.py +1 -0
  438. loopx/control_plane/handoff/cross_runtime_impl_review.py +311 -0
  439. loopx/control_plane/handoff/delivery_contract.py +161 -0
  440. loopx/control_plane/handoff/handoff_runs.py +71 -0
  441. loopx/control_plane/handoff/project_handoff.py +155 -0
  442. loopx/control_plane/handoff/review_batch.py +463 -0
  443. loopx/control_plane/handoff/review_packet_context.py +216 -0
  444. loopx/control_plane/heartbeat/agent.py +173 -0
  445. loopx/control_plane/heartbeat/budget.py +66 -0
  446. loopx/control_plane/heartbeat/builder.py +501 -0
  447. loopx/control_plane/heartbeat/host.py +64 -0
  448. loopx/control_plane/heartbeat/rules.py +68 -0
  449. loopx/control_plane/heartbeat/task_body.py +759 -0
  450. loopx/control_plane/heartbeat/visible_goal.py +86 -0
  451. loopx/control_plane/projects/__init__.py +1 -0
  452. loopx/control_plane/projects/contract.py +25 -0
  453. loopx/control_plane/projects/registry.py +663 -0
  454. loopx/control_plane/quota/__init__.py +1 -0
  455. loopx/control_plane/quota/cli_projection.py +704 -0
  456. loopx/control_plane/quota/decision_summary.py +431 -0
  457. loopx/control_plane/quota/effect_program.py +152 -0
  458. loopx/control_plane/quota/error_codes.py +19 -0
  459. loopx/control_plane/quota/goal_boundary.py +464 -0
  460. loopx/control_plane/quota/heartbeat_receipt.py +277 -0
  461. loopx/control_plane/quota/heartbeat_recommendation.py +718 -0
  462. loopx/control_plane/quota/host_poll_receipts.py +162 -0
  463. loopx/control_plane/quota/live_decision.py +142 -0
  464. loopx/control_plane/quota/monitor_poll.py +786 -0
  465. loopx/control_plane/quota/policy_constants.py +40 -0
  466. loopx/control_plane/quota/projection_repair.py +262 -0
  467. loopx/control_plane/quota/recent_runs.py +210 -0
  468. loopx/control_plane/quota/scheduler_ack.py +490 -0
  469. loopx/control_plane/quota/selected_todo_projection.py +139 -0
  470. loopx/control_plane/quota/settlement.py +437 -0
  471. loopx/control_plane/quota/settlement_cli.py +246 -0
  472. loopx/control_plane/quota/settlement_validation.py +64 -0
  473. loopx/control_plane/quota/settlement_workspace_causality.py +180 -0
  474. loopx/control_plane/quota/should_run.py +249 -0
  475. loopx/control_plane/quota/should_run_packet.py +1165 -0
  476. loopx/control_plane/quota/should_run_prepare.py +675 -0
  477. loopx/control_plane/quota/slot_accounting.py +1123 -0
  478. loopx/control_plane/quota/spend_sources.py +11 -0
  479. loopx/control_plane/quota/stall_repair.py +397 -0
  480. loopx/control_plane/quota/states.py +29 -0
  481. loopx/control_plane/quota/task_orchestration.py +448 -0
  482. loopx/control_plane/quota/task_orchestration_admission.py +497 -0
  483. loopx/control_plane/quota/turn_envelope.py +889 -0
  484. loopx/control_plane/quota/usage_summary.py +140 -0
  485. loopx/control_plane/reward_memory.py +43 -0
  486. loopx/control_plane/runtime/__init__.py +2 -0
  487. loopx/control_plane/runtime/active_user_assisted_pilot.py +275 -0
  488. loopx/control_plane/runtime/agent_scoped_evidence_log.py +435 -0
  489. loopx/control_plane/runtime/decision_freshness.py +203 -0
  490. loopx/control_plane/runtime/event_ledger.py +197 -0
  491. loopx/control_plane/runtime/event_store_migration_bridge.py +196 -0
  492. loopx/control_plane/runtime/goal_project_route.py +70 -0
  493. loopx/control_plane/runtime/local_state_write_correctness.py +242 -0
  494. loopx/control_plane/runtime/promotion_readiness.py +152 -0
  495. loopx/control_plane/runtime/public_safety.py +120 -0
  496. loopx/control_plane/runtime/run_artifacts.py +78 -0
  497. loopx/control_plane/runtime/run_compaction.py +397 -0
  498. loopx/control_plane/runtime/run_context_retention.py +241 -0
  499. loopx/control_plane/runtime/run_history.py +132 -0
  500. loopx/control_plane/runtime/run_index_duplicates.py +205 -0
  501. loopx/control_plane/runtime/run_index_rebuild.py +263 -0
  502. loopx/control_plane/runtime/run_ingest_health.py +336 -0
  503. loopx/control_plane/runtime/runtime_projection_route.py +624 -0
  504. loopx/control_plane/runtime/runtime_projection_writer.py +98 -0
  505. loopx/control_plane/runtime/session_runtime.py +339 -0
  506. loopx/control_plane/runtime/shared_runtime_material_projection.py +332 -0
  507. loopx/control_plane/runtime/shared_runtime_refresh_projection.py +183 -0
  508. loopx/control_plane/runtime/stale_latest_run.py +90 -0
  509. loopx/control_plane/runtime/status_classifications.py +49 -0
  510. loopx/control_plane/runtime/status_projection_cache.py +235 -0
  511. loopx/control_plane/runtime/stride_observation.py +144 -0
  512. loopx/control_plane/runtime/time.py +39 -0
  513. loopx/control_plane/runtime/trajectory_hygiene.py +149 -0
  514. loopx/control_plane/runtime/validation_command.py +69 -0
  515. loopx/control_plane/scheduler/__init__.py +1 -0
  516. loopx/control_plane/scheduler/ack.py +329 -0
  517. loopx/control_plane/scheduler/arbitration.py +188 -0
  518. loopx/control_plane/scheduler/automation_liveness.py +183 -0
  519. loopx/control_plane/scheduler/execution_context.py +555 -0
  520. loopx/control_plane/scheduler/external_evidence_observation.py +428 -0
  521. loopx/control_plane/scheduler/monitor_display.py +143 -0
  522. loopx/control_plane/scheduler/monitor_poll_policy.py +161 -0
  523. loopx/control_plane/scheduler/monitor_poll_writeback.py +351 -0
  524. loopx/control_plane/scheduler/monitor_target.py +64 -0
  525. loopx/control_plane/scheduler/monitor_todo.py +146 -0
  526. loopx/control_plane/scheduler/monitor_wait.py +237 -0
  527. loopx/control_plane/scheduler/scheduler_hint.py +1284 -0
  528. loopx/control_plane/scheduler/state.py +354 -0
  529. loopx/control_plane/scheduler/state_transition_rules.py +179 -0
  530. loopx/control_plane/scheduler/time.py +10 -0
  531. loopx/control_plane/settlement_driver.py +293 -0
  532. loopx/control_plane/status/__init__.py +6 -0
  533. loopx/control_plane/status/active_state_projection.py +105 -0
  534. loopx/control_plane/status/agent_lane_projection.py +375 -0
  535. loopx/control_plane/status/attention_projection.py +74 -0
  536. loopx/control_plane/status/autonomous_replan_projection.py +103 -0
  537. loopx/control_plane/status/collection.py +140 -0
  538. loopx/control_plane/status/contract_projection.py +31 -0
  539. loopx/control_plane/status/dreaming_projection.py +52 -0
  540. loopx/control_plane/status/goal_attention_projection.py +157 -0
  541. loopx/control_plane/status/lifecycle_projection.py +110 -0
  542. loopx/control_plane/status/monitor_display_projection.py +69 -0
  543. loopx/control_plane/status/registry_health_projection.py +75 -0
  544. loopx/control_plane/status/run_projection.py +70 -0
  545. loopx/control_plane/status/runtime_summaries.py +161 -0
  546. loopx/control_plane/testing/__init__.py +1 -0
  547. loopx/control_plane/testing/actual_default_model_behavior_portfolio.py +1371 -0
  548. loopx/control_plane/testing/canary_harness.py +182 -0
  549. loopx/control_plane/testing/capability_monitor_repair_tool_behavior.py +674 -0
  550. loopx/control_plane/testing/cli_output_budget.py +807 -0
  551. loopx/control_plane/testing/cli_output_differential.py +250 -0
  552. loopx/control_plane/testing/cli_output_semantics.py +87 -0
  553. loopx/control_plane/testing/control_plane_composition_scenarios.py +225 -0
  554. loopx/control_plane/testing/decision_replay.py +268 -0
  555. loopx/control_plane/testing/doubao_model_behavior_actor.py +559 -0
  556. loopx/control_plane/testing/model_behavior_corpus.py +344 -0
  557. loopx/control_plane/testing/model_behavior_qualification.py +769 -0
  558. loopx/control_plane/testing/model_behavior_retained_cases.py +235 -0
  559. loopx/control_plane/testing/model_tool_behavior.py +536 -0
  560. loopx/control_plane/testing/onboarding_model_behavior_qualification.py +642 -0
  561. loopx/control_plane/testing/quota_fixtures.py +208 -0
  562. loopx/control_plane/testing/quota_should_run_parity.py +57 -0
  563. loopx/control_plane/testing/release_commit_qualification.py +671 -0
  564. loopx/control_plane/testing/replan_semantic_action_behavior.py +1302 -0
  565. loopx/control_plane/testing/scoped_gate_successor_tool_behavior.py +527 -0
  566. loopx/control_plane/testing/selected_todo_tool_behavior.py +1002 -0
  567. loopx/control_plane/testing/terminal_settlement_tool_behavior.py +656 -0
  568. loopx/control_plane/todos/__init__.py +1 -0
  569. loopx/control_plane/todos/active_state_editing.py +296 -0
  570. loopx/control_plane/todos/active_state_todo_parser.py +138 -0
  571. loopx/control_plane/todos/active_state_todos.py +175 -0
  572. loopx/control_plane/todos/addition.py +103 -0
  573. loopx/control_plane/todos/claim_visibility.py +253 -0
  574. loopx/control_plane/todos/completed_archive.py +139 -0
  575. loopx/control_plane/todos/completion_fence.py +49 -0
  576. loopx/control_plane/todos/completion_policy.py +153 -0
  577. loopx/control_plane/todos/completion_validation.py +248 -0
  578. loopx/control_plane/todos/completion_validation_accountability.py +27 -0
  579. loopx/control_plane/todos/completion_validation_projection.py +57 -0
  580. loopx/control_plane/todos/contract.py +1476 -0
  581. loopx/control_plane/todos/decision_scope.py +554 -0
  582. loopx/control_plane/todos/deferred_resume.py +546 -0
  583. loopx/control_plane/todos/durable_completion.py +201 -0
  584. loopx/control_plane/todos/event_writeback.py +484 -0
  585. loopx/control_plane/todos/frontier_deadline.py +132 -0
  586. loopx/control_plane/todos/handoff_gate.py +283 -0
  587. loopx/control_plane/todos/handoff_mode.py +444 -0
  588. loopx/control_plane/todos/handoff_note.py +202 -0
  589. loopx/control_plane/todos/line_update.py +361 -0
  590. loopx/control_plane/todos/list_projection.py +205 -0
  591. loopx/control_plane/todos/markdown.py +199 -0
  592. loopx/control_plane/todos/monitor_metadata.py +88 -0
  593. loopx/control_plane/todos/mutation_authority.py +299 -0
  594. loopx/control_plane/todos/projection.py +655 -0
  595. loopx/control_plane/todos/quota_summary.py +1138 -0
  596. loopx/control_plane/todos/route_continuation.py +267 -0
  597. loopx/control_plane/todos/succession_warning.py +174 -0
  598. loopx/control_plane/todos/summary_item.py +223 -0
  599. loopx/control_plane/todos/text.py +30 -0
  600. loopx/control_plane/todos/todo_index.py +226 -0
  601. loopx/control_plane/todos/todo_summary.py +1458 -0
  602. loopx/control_plane/todos/unblock_resume.py +326 -0
  603. loopx/control_plane/todos/user_gate.py +263 -0
  604. loopx/control_plane/todos/write_hint.py +63 -0
  605. loopx/control_plane/todos/write_policy.py +135 -0
  606. loopx/control_plane/turn_driver/__init__.py +85 -0
  607. loopx/control_plane/turn_driver/codex_cli.py +502 -0
  608. loopx/control_plane/turn_driver/driver.py +355 -0
  609. loopx/control_plane/turn_driver/executor.py +1468 -0
  610. loopx/control_plane/turn_driver/loop_controller.py +669 -0
  611. loopx/control_plane/turn_driver/settlement.py +318 -0
  612. loopx/control_plane/turn_driver/transaction.py +375 -0
  613. loopx/control_plane/work_items/__init__.py +1 -0
  614. loopx/control_plane/work_items/attention_fields.py +56 -0
  615. loopx/control_plane/work_items/attention_item.py +77 -0
  616. loopx/control_plane/work_items/attention_queue.py +322 -0
  617. loopx/control_plane/work_items/attention_routing.py +213 -0
  618. loopx/control_plane/work_items/autonomous_candidates.py +135 -0
  619. loopx/control_plane/work_items/autonomous_replan_ack.py +276 -0
  620. loopx/control_plane/work_items/autonomous_replan_obligation.py +786 -0
  621. loopx/control_plane/work_items/backlog_hygiene.py +59 -0
  622. loopx/control_plane/work_items/capability_monitor_fallback.py +221 -0
  623. loopx/control_plane/work_items/delivery_batch_scale.py +66 -0
  624. loopx/control_plane/work_items/delivery_outcome.py +152 -0
  625. loopx/control_plane/work_items/delivery_signals.py +113 -0
  626. loopx/control_plane/work_items/execution_obligation.py +235 -0
  627. loopx/control_plane/work_items/goal_route_hint.py +320 -0
  628. loopx/control_plane/work_items/interaction_contract.py +1540 -0
  629. loopx/control_plane/work_items/issue_meta_surface.py +159 -0
  630. loopx/control_plane/work_items/lifecycle.py +139 -0
  631. loopx/control_plane/work_items/operator_inbox.py +266 -0
  632. loopx/control_plane/work_items/outcome_followthrough.py +69 -0
  633. loopx/control_plane/work_items/primary_action.py +326 -0
  634. loopx/control_plane/work_items/progress_observation.py +630 -0
  635. loopx/control_plane/work_items/project_asset.py +675 -0
  636. loopx/control_plane/work_items/repair_delta.py +693 -0
  637. loopx/control_plane/work_items/runtime_capability_reentry.py +168 -0
  638. loopx/control_plane/work_items/semantic_replan_writeback.py +177 -0
  639. loopx/control_plane/work_items/status_contract.py +49 -0
  640. loopx/control_plane/work_items/task_graph.py +1046 -0
  641. loopx/control_plane/work_items/task_lease.py +1254 -0
  642. loopx/control_plane/work_items/task_lease_settlement.py +422 -0
  643. loopx/control_plane/work_items/work_lane.py +510 -0
  644. loopx/control_plane/work_items/work_lane_context.py +161 -0
  645. loopx/demo.py +247 -0
  646. loopx/diagnose.py +633 -0
  647. loopx/doctor.py +1251 -0
  648. loopx/domain_packs/__init__.py +1 -0
  649. loopx/domain_packs/issue_fix.py +571 -0
  650. loopx/domain_packs/ml_experiment.py +854 -0
  651. loopx/domain_state.py +137 -0
  652. loopx/dreaming.py +706 -0
  653. loopx/entrypoint.py +16 -0
  654. loopx/event_sourced_state.py +981 -0
  655. loopx/execution_profile.py +286 -0
  656. loopx/experiments/__init__.py +1 -0
  657. loopx/experiments/planner_worker/__init__.py +1 -0
  658. loopx/experiments/planner_worker/contract.py +523 -0
  659. loopx/experiments/planner_worker/runtime.py +391 -0
  660. loopx/experiments/planner_worker/traex.py +461 -0
  661. loopx/explore_graph.py +11 -0
  662. loopx/extensions/__init__.py +1 -0
  663. loopx/extensions/bundled.py +28 -0
  664. loopx/extensions/execution_envelope.py +126 -0
  665. loopx/extensions/lark/__init__.py +11 -0
  666. loopx/extensions/lark/event_collector.py +478 -0
  667. loopx/extensions/lark/event_collector_runtime.py +506 -0
  668. loopx/extensions/lark/event_inbox.py +454 -0
  669. loopx/extensions/lark/extension.toml +88 -0
  670. loopx/extensions/lark/goal_channel.py +44 -0
  671. loopx/extensions/lark/goal_channel_contracts.py +388 -0
  672. loopx/extensions/lark/goal_channel_lifecycle.py +218 -0
  673. loopx/extensions/lark/goal_channel_runtime.py +792 -0
  674. loopx/extensions/lark/goal_channel_setup.py +805 -0
  675. loopx/extensions/lark/goal_channel_targets.py +215 -0
  676. loopx/extensions/lark/goal_channel_transport.py +281 -0
  677. loopx/extensions/lark/inbox_reactions.py +650 -0
  678. loopx/extensions/lark/inbox_reply.py +430 -0
  679. loopx/extensions/lark/presentation/__init__.py +11 -0
  680. loopx/extensions/lark/presentation/explore_results.py +2276 -0
  681. loopx/extensions/lark/presentation/explore_singleflight.py +127 -0
  682. loopx/extensions/lark/presentation/explore_source_guard.py +121 -0
  683. loopx/extensions/lark/presentation/explore_stage_document.py +703 -0
  684. loopx/extensions/lark/presentation/explore_visual_integrity.py +122 -0
  685. loopx/extensions/lark/presentation/explore_visual_readback.py +452 -0
  686. loopx/extensions/lark/presentation/explore_visual_styles.py +156 -0
  687. loopx/extensions/lark/presentation/issue_fix_surface.py +612 -0
  688. loopx/extensions/lark/presentation/kanban.py +2791 -0
  689. loopx/extensions/lark/presentation/message_card.py +112 -0
  690. loopx/extensions/lark/presentation/periodic_report.py +261 -0
  691. loopx/extensions/lark/presentation/projection_rows.py +600 -0
  692. loopx/extensions/lark/presentation/record_io.py +95 -0
  693. loopx/extensions/lark/presentation/sync_receipt.py +145 -0
  694. loopx/extensions/lark/private_json.py +40 -0
  695. loopx/extensions/lark/provider.py +86 -0
  696. loopx/extensions/lark/reviewer_notification.py +604 -0
  697. loopx/extensions/manifest.py +385 -0
  698. loopx/extensions/openviking_periodic_report/__init__.py +17 -0
  699. loopx/extensions/openviking_periodic_report/activation.py +173 -0
  700. loopx/extensions/openviking_periodic_report/extension.toml +17 -0
  701. loopx/extensions/openviking_periodic_report/provider.py +355 -0
  702. loopx/extensions/openviking_periodic_report/sink.py +117 -0
  703. loopx/extensions/openviking_semantic_preference/__init__.py +5 -0
  704. loopx/extensions/openviking_semantic_preference/extension.toml +16 -0
  705. loopx/extensions/openviking_semantic_preference/history_export.py +484 -0
  706. loopx/extensions/openviking_semantic_preference/project_peer.py +68 -0
  707. loopx/extensions/openviking_semantic_preference/provider.py +312 -0
  708. loopx/extensions/presentation.py +979 -0
  709. loopx/extensions/process_runtime.py +204 -0
  710. loopx/extensions/readiness.py +168 -0
  711. loopx/extensions/runtime.py +931 -0
  712. loopx/extensions/scaffold.py +335 -0
  713. loopx/feedback.py +581 -0
  714. loopx/file_lock.py +382 -0
  715. loopx/global_registry.py +842 -0
  716. loopx/global_risks.py +970 -0
  717. loopx/global_todos.py +568 -0
  718. loopx/handoff_budget.py +28 -0
  719. loopx/heartbeat_prequota.py +80 -0
  720. loopx/heartbeat_prompt.py +159 -0
  721. loopx/help_surface.py +516 -0
  722. loopx/history.py +1507 -0
  723. loopx/host_loop_activation.py +1311 -0
  724. loopx/host_mode_planner.py +991 -0
  725. loopx/install_contract.py +1 -0
  726. loopx/interface_budget.py +196 -0
  727. loopx/long_task_cadence.py +208 -0
  728. loopx/materials.py +185 -0
  729. loopx/ml_experiment.py +3 -0
  730. loopx/onboarding.py +214 -0
  731. loopx/opencode2_goal_mode/README.md +81 -0
  732. loopx/opencode2_goal_mode/__init__.py +9 -0
  733. loopx/opencode2_goal_mode/opencode2-goal-worker.mjs +1018 -0
  734. loopx/opencode_goal_mode/README.md +99 -0
  735. loopx/opencode_goal_mode/__init__.py +13 -0
  736. loopx/opencode_goal_mode/goal-bridge-runtime.mjs +858 -0
  737. loopx/opencode_goal_mode/loopx-goal.js +8 -0
  738. loopx/operator_gate.py +420 -0
  739. loopx/orchestration.py +127 -0
  740. loopx/paths.py +59 -0
  741. loopx/pi_goal_mode/README.md +67 -0
  742. loopx/pi_goal_mode/__init__.py +13 -0
  743. loopx/pi_goal_mode/loopx-goal.ts +254 -0
  744. loopx/pi_goal_mode/pi-goal-loop-runtime.mjs +574 -0
  745. loopx/pr_review.py +1206 -0
  746. loopx/presentation/__init__.py +1 -0
  747. loopx/presentation/explore_views.py +1334 -0
  748. loopx/presentation/markdown.py +61 -0
  749. loopx/presentation/projection_source_reconcile.py +140 -0
  750. loopx/presentation/public_safety.py +42 -0
  751. loopx/presentation/renderers/__init__.py +17 -0
  752. loopx/presentation/renderers/goal_channel_html.py +269 -0
  753. loopx/presentation/renderers/periodic_report_html.py +786 -0
  754. loopx/presentation/renderers/periodic_report_markdown.py +184 -0
  755. loopx/presentation/renderers/quota_event_markdown.py +116 -0
  756. loopx/presentation/renderers/quota_markdown.py +1112 -0
  757. loopx/presentation/renderers/status_markdown.py +1570 -0
  758. loopx/presentation/renderers/trajectory_hygiene_markdown.py +39 -0
  759. loopx/presentation/renderers/turn_envelope_markdown.py +33 -0
  760. loopx/presentation/sinks/__init__.py +5 -0
  761. loopx/presentation/sinks/openviking_periodic_report.py +7 -0
  762. loopx/presentation/static_site.py +691 -0
  763. loopx/presets.py +369 -0
  764. loopx/project_alias.py +217 -0
  765. loopx/project_map.py +589 -0
  766. loopx/project_prompt.py +1153 -0
  767. loopx/project_skill_cli.py +125 -0
  768. loopx/project_skill_delivery.py +470 -0
  769. loopx/project_uninstall.py +462 -0
  770. loopx/promotion_gate.py +197 -0
  771. loopx/quota.py +1197 -0
  772. loopx/ready_score.py +413 -0
  773. loopx/registry.py +621 -0
  774. loopx/registry_writability.py +64 -0
  775. loopx/release_candidate.py +148 -0
  776. loopx/release_manifest.py +316 -0
  777. loopx/repository_identity.py +100 -0
  778. loopx/review_packet.py +1024 -0
  779. loopx/rollout_event_log.py +505 -0
  780. loopx/runtime.py +112 -0
  781. loopx/self_update.py +750 -0
  782. loopx/session_runtime.py +418 -0
  783. loopx/skill_install_readback.py +500 -0
  784. loopx/slash_command_install.py +1393 -0
  785. loopx/slash_commands.py +264 -0
  786. loopx/state_backup.py +573 -0
  787. loopx/state_migration.py +350 -0
  788. loopx/state_projection.py +809 -0
  789. loopx/state_refresh.py +1416 -0
  790. loopx/status.py +1383 -0
  791. loopx/status_server.py +935 -0
  792. loopx/summary_all.py +725 -0
  793. loopx/terminal_bench_agent.py +2056 -0
  794. loopx/thread_agent_binding.py +408 -0
  795. loopx/todo_followups.py +168 -0
  796. loopx/todo_suggestion_prompt.py +204 -0
  797. loopx/todos.py +2229 -0
  798. loopx/turn_identity.py +17 -0
  799. loopx/upgrade.py +1083 -0
  800. loopx/visible_governance.py +667 -0
  801. loopx/visible_multi_agent_launcher.py +1253 -0
  802. loopx/visible_multi_agent_tmux.py +429 -0
  803. loopx/worker_bridge.py +1574 -0
  804. loopx-0.4.8.dist-info/METADATA +708 -0
  805. loopx-0.4.8.dist-info/RECORD +811 -0
  806. loopx-0.4.8.dist-info/WHEEL +5 -0
  807. loopx-0.4.8.dist-info/entry_points.txt +5 -0
  808. loopx-0.4.8.dist-info/licenses/LICENSE +202 -0
  809. loopx-0.4.8.dist-info/licenses/LICENSE-MIT +21 -0
  810. loopx-0.4.8.dist-info/licenses/NOTICE +6 -0
  811. loopx-0.4.8.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1984 @@
1
+ from __future__ import annotations
2
+
3
+ import re
4
+ from pathlib import Path
5
+ from typing import Any
6
+
7
+ from .qualification_profiles import CONTROL_PLANE_QUALIFICATION_PROFILES
8
+ from .quality_surface_catalog import (
9
+ build_quality_surface_catalog_audit as _build_quality_surface_catalog_audit,
10
+ )
11
+ from .release_profiles import RELEASE_PROMOTION_PROFILE
12
+
13
+
14
+ CANARY_PROFILE_SCHEMA_VERSION = "catalog_canary_profile_v0"
15
+ CANARY_DOMAIN_PROFILE_SCHEMA_VERSION = "catalog_canary_domain_profile_v0"
16
+ CANARY_PROFILES_SCHEMA_VERSION = "catalog_canary_profiles_v0"
17
+ CANARY_PLAN_SCHEMA_VERSION = "catalog_canary_plan_v0"
18
+ CANARY_COVERAGE_AUDIT_SCHEMA_VERSION = "catalog_canary_coverage_audit_v0"
19
+
20
+ REPO_ROOT = Path(__file__).resolve().parents[2]
21
+ DEFAULT_CATALOG_PATH = REPO_ROOT / "docs" / "concepts" / "interaction-pattern-catalog.md"
22
+
23
+
24
+ FAMILY_CHECKS: dict[str, list[dict[str, str]]] = {
25
+ "Work Routing": [
26
+ {
27
+ "command": "python3 examples/control_plane/quota-plan-smoke.py",
28
+ "reason": "exercises quota should-run routing, fallback, and execution obligation projection",
29
+ },
30
+ {
31
+ "command": "python3 examples/control_plane/quota-work-lane-policy-smoke.py",
32
+ "reason": "checks advancement, monitor, and no-work lane policy selection",
33
+ },
34
+ {
35
+ "command": "python3 examples/control_plane/monitor-scheduler-contract-smoke.py",
36
+ "reason": "guards due-monitor routing without requiring real external polling",
37
+ },
38
+ {
39
+ "command": "python3 examples/control_plane/heartbeat-prompt-smoke.py",
40
+ "reason": "checks heartbeat prompt and scheduler guidance for controller loops",
41
+ },
42
+ ],
43
+ "Human Decision": [
44
+ {
45
+ "command": "python3 examples/control_plane/todo-user-gate-scope-smoke.py",
46
+ "reason": "checks scoped user-gate projection instead of global prose gates",
47
+ },
48
+ {
49
+ "command": "python3 examples/project/operator-gate-resume-contract-smoke.py",
50
+ "reason": "exercises operator gate preview and resume behavior",
51
+ },
52
+ {
53
+ "command": "python3 examples/reward-gate-direct-write-contract-smoke.py",
54
+ "reason": "guards reward/gate write boundaries before agent continuation",
55
+ },
56
+ {
57
+ "command": "python3 examples/control_plane/quota-agent-scoped-user-gate-smoke.py",
58
+ "reason": "checks that agent-scoped user gates do not block unrelated lanes",
59
+ },
60
+ ],
61
+ "State And Boundary": [
62
+ {
63
+ "command": "python3 examples/control_plane/todo-contract-smoke.py",
64
+ "reason": "checks todo metadata shape consumed by status and quota",
65
+ },
66
+ {
67
+ "command": "python3 examples/control_plane/todo-readmodel-boundary-smoke.py",
68
+ "reason": "guards status wrapper parity for todo read-model extraction",
69
+ },
70
+ {
71
+ "command": "python3 examples/control_plane/active-state-structured-projection-smoke.py",
72
+ "reason": "guards active-state structured projection from Markdown drift",
73
+ },
74
+ {
75
+ "command": "python3 examples/control_plane/task-graph-projection-fixture-smoke.py",
76
+ "reason": "checks task graph projection and lineage without private sources",
77
+ },
78
+ {
79
+ "command": "python3 examples/control_plane/check-public-boundary-smoke.py",
80
+ "reason": "guards public/private boundary scanning for touched files",
81
+ },
82
+ ],
83
+ "Evidence Lifecycle": [
84
+ {
85
+ "command": "python3 examples/benchmark-run-ledger-smoke.py",
86
+ "reason": "checks compact benchmark/run evidence without raw logs",
87
+ },
88
+ {
89
+ "command": "python3 examples/benchmark-case-analysis-smoke.py",
90
+ "reason": "checks reusable case-analysis projections from compact artifacts",
91
+ },
92
+ {
93
+ "command": "python3 examples/benchmark-artifact-path-filter-smoke.py",
94
+ "reason": "guards raw/private artifact path exclusion",
95
+ },
96
+ {
97
+ "command": "python3 examples/content-ops-public-handle-observation-smoke.py",
98
+ "reason": "checks public-handle evidence observation without private connector reads",
99
+ },
100
+ ],
101
+ "Planning Governance": [
102
+ {
103
+ "command": "python3 examples/autonomous-replan-obligation-smoke.py",
104
+ "reason": "guards stalled-turn autonomous replan obligations",
105
+ },
106
+ {
107
+ "command": "python3 examples/control_plane/monitor-poll-writeback-smoke.py",
108
+ "reason": "checks monitor poll writeback and no-spend replan triggers",
109
+ },
110
+ {
111
+ "command": "python3 examples/control_plane/refresh-state-write-correctness-smoke.py",
112
+ "reason": "checks refresh-state writeback correctness and projection updates",
113
+ },
114
+ {
115
+ "command": "python3 examples/dreaming-dry-run-proposal-smoke.py",
116
+ "reason": "checks planning proposal preview remains dry-run and machine-visible",
117
+ },
118
+ ],
119
+ }
120
+
121
+
122
+ FAMILY_SELECTOR_HINTS: dict[str, tuple[str, ...]] = {
123
+ "Work Routing": (
124
+ "quota",
125
+ "should-run",
126
+ "status",
127
+ "review-packet",
128
+ "heartbeat",
129
+ "scheduler",
130
+ "work-lane",
131
+ "monitor",
132
+ "handoff",
133
+ "loopx/quota.py",
134
+ "loopx/status.py",
135
+ "loopx/review_packet.py",
136
+ "loopx/heartbeat_prompt.py",
137
+ ),
138
+ "Human Decision": (
139
+ "user todo",
140
+ "operator-gate",
141
+ "reward",
142
+ "decision-scope",
143
+ "deferred",
144
+ "gate",
145
+ "loopx/operator_gate.py",
146
+ "loopx/control_plane/todos/decision_scope.py",
147
+ "loopx/feedback.py",
148
+ ),
149
+ "State And Boundary": (
150
+ "active state",
151
+ "todo",
152
+ "task graph",
153
+ "authority",
154
+ "boundary",
155
+ "connector",
156
+ "public/private",
157
+ "loopx/todos.py",
158
+ "loopx/control_plane/todos/contract.py",
159
+ "loopx/status.py",
160
+ "loopx/state_projection.py",
161
+ "loopx/boundary_authority.py",
162
+ "loopx/authority.py",
163
+ ),
164
+ "Evidence Lifecycle": (
165
+ "benchmark",
166
+ "evidence",
167
+ "ledger",
168
+ "artifact",
169
+ "public handle",
170
+ "ci",
171
+ "content-ops",
172
+ "worker_bridge",
173
+ "loopx/benchmark",
174
+ "loopx/worker_bridge.py",
175
+ "loopx/capabilities/content_ops",
176
+ ),
177
+ "Planning Governance": (
178
+ "replan",
179
+ "repair",
180
+ "cadence",
181
+ "dreaming",
182
+ "plan-to-todo",
183
+ "refresh-state",
184
+ "monitor-poll",
185
+ "loopx/dreaming.py",
186
+ "loopx/state_refresh.py",
187
+ "loopx/long_task_cadence.py",
188
+ ),
189
+ }
190
+
191
+
192
+ CURRENT_REPO_PROFILES: tuple[dict[str, Any], ...] = (
193
+ {
194
+ "id": "pr-review-and-merge",
195
+ "title": "PR review and merge workflow",
196
+ "purpose": "Check public PR review packets, public-handle evidence, and merge-gate boundaries without approving or merging anything.",
197
+ "catalog_families": ["Human Decision", "Evidence Lifecycle", "State And Boundary"],
198
+ "trigger_hints": ("pr-review", "pull request", "github pr", "self-merge", "merge policy", "public pr metadata"),
199
+ "checks": [
200
+ {
201
+ "command": "python3 examples/pr-review-command-smoke.py",
202
+ "tier": "default",
203
+ "reason": "checks the public-safe /loopx-pr-review packet and review-card contract",
204
+ },
205
+ {
206
+ "command": "python3 examples/value-connectors-github-public-probe-smoke.py",
207
+ "tier": "default",
208
+ "reason": "guards public GitHub issue/PR metadata probes without raw body capture",
209
+ },
210
+ {
211
+ "command": "python3 examples/control_plane/check-public-boundary-smoke.py",
212
+ "tier": "deep",
213
+ "reason": "runs broader public/private boundary checks when review artifacts are promoted",
214
+ },
215
+ ],
216
+ },
217
+ RELEASE_PROMOTION_PROFILE,
218
+ {
219
+ "id": "install-update",
220
+ "title": "Install and update safety",
221
+ "quality_risk": "high",
222
+ "purpose": "Check local install, packaged install, update planning, rollback, and uninstall safety before install/update changes ship.",
223
+ "catalog_families": ["State And Boundary", "Work Routing", "Planning Governance"],
224
+ "trigger_hints": (
225
+ "install",
226
+ "installer",
227
+ "packaged install",
228
+ "install-local",
229
+ "install-from-github",
230
+ "loopx update",
231
+ "self-update",
232
+ "update command",
233
+ "upgrade",
234
+ "rollback",
235
+ "uninstall",
236
+ "scripts/install-local.sh",
237
+ "scripts/install-from-github.sh",
238
+ "loopx/self_update.py",
239
+ "loopx/cli_commands/update",
240
+ ),
241
+ "checks": [
242
+ {
243
+ "command": "python3 examples/install-local-smoke.py",
244
+ "tier": "default",
245
+ "reason": "guards the local installer wrapper, skill installation, and install freshness reporting",
246
+ },
247
+ {
248
+ "command": "python3 examples/release/local-install-promotion-boundary-smoke.py",
249
+ "tier": "deep",
250
+ "reason": "guards explicit default promotion while keeping dirty or non-main checkouts canary-only",
251
+ },
252
+ {
253
+ "command": "python3 examples/codex-cli-packaged-install-smoke.py",
254
+ "tier": "default",
255
+ "reason": "checks packaged GitHub/archive install behavior in a temporary home",
256
+ },
257
+ {
258
+ "command": "python3 examples/loopx-update-smoke.py",
259
+ "tier": "default",
260
+ "reason": "checks update planning, check-only behavior, rollback planning, and rollback execution fixtures",
261
+ },
262
+ {
263
+ "command": "python3 examples/install-local-overwrite-smoke.py",
264
+ "tier": "deep",
265
+ "reason": "guards existing loopx executable overwrite and directory-conflict safety",
266
+ },
267
+ {
268
+ "command": "python3 examples/protocol/rollback-packet-protocol-smoke.py",
269
+ "tier": "deep",
270
+ "reason": "validates the public rollback packet protocol and fixture boundary",
271
+ },
272
+ {
273
+ "command": "python3 examples/project/project-uninstall-smoke.py",
274
+ "tier": "deep",
275
+ "reason": "samples project-local uninstall safety with isolated fixture registries",
276
+ },
277
+ {
278
+ "command": "python3 examples/worker-bridge-install-contract-smoke.py",
279
+ "tier": "deep",
280
+ "reason": "checks generic worker bridge install contracts without exposing private runtime material",
281
+ },
282
+ ],
283
+ },
284
+ {
285
+ "id": "control-plane-refactor",
286
+ "title": "Control-plane refactor safety",
287
+ "purpose": "Sample hot-path route, policy seam, and interface budget checks for quota/status refactors.",
288
+ "catalog_families": ["Work Routing", "State And Boundary", "Planning Governance"],
289
+ "trigger_hints": (
290
+ "refactor",
291
+ "quota.py",
292
+ "status.py",
293
+ "control-plane",
294
+ "policy seam",
295
+ "work-lane policy",
296
+ "resume_when",
297
+ "resume_ready",
298
+ "handoff",
299
+ "blocks_agent",
300
+ "unblocks_todo_id",
301
+ "successor",
302
+ "monitor_target",
303
+ "monitor_poll_writeback",
304
+ "loopx/control_plane/scheduler/monitor_todo.py",
305
+ "loopx/control_plane/scheduler/monitor_wait.py",
306
+ "loopx/control_plane/scheduler/monitor_poll_writeback.py",
307
+ "loopx/control_plane/scheduler/monitor_target.py",
308
+ "loopx/control_plane/scheduler/scheduler_hint.py",
309
+ "loopx/control_plane/quota/stall_repair.py",
310
+ "loopx/control_plane/scheduler/arbitration.py",
311
+ "loopx/control_plane/todos/decision_scope.py",
312
+ "loopx/control_plane/testing/decision_replay.py",
313
+ "loopx/control_plane/work_items/interaction_contract.py",
314
+ "loopx/control_plane/todos/handoff_gate.py",
315
+ "loopx/control_plane/work_items/execution_obligation.py",
316
+ "loopx/control_plane/work_items/goal_route_hint.py",
317
+ "loopx/control_plane/work_items/outcome_followthrough.py",
318
+ "loopx/control_plane/work_items/work_lane.py",
319
+ "loopx/control_plane/runtime/event_store_migration_bridge.py",
320
+ ),
321
+ "checks": [
322
+ {
323
+ "command": "python3 examples/control_plane/bounded-context-namespace-smoke.py",
324
+ "tier": "default",
325
+ "reason": "prevents repo-local code and smokes from depending on legacy projection shims after bounded-context moves",
326
+ },
327
+ {
328
+ "command": "python3 examples/control_plane/control-plane-risk-characterization-smoke.py",
329
+ "tier": "default",
330
+ "reason": "characterizes shared control-plane routing, scheduler, and review-packet risks",
331
+ },
332
+ {
333
+ "command": "python3 examples/control_plane/hot-path-interface-budget-smoke.py",
334
+ "tier": "default",
335
+ "reason": "keeps hot-path payload and module growth bounded",
336
+ },
337
+ {
338
+ "command": "python3 examples/control_plane/quota-resume-gated-open-todo-smoke.py",
339
+ "tier": "default",
340
+ "reason": "guards resume_when-gated open todos from entering executable quota lanes early",
341
+ },
342
+ {
343
+ "command": "python3 examples/control_plane/quota-cleared-blocker-successor-gate-smoke.py",
344
+ "tier": "default",
345
+ "reason": "guards cleared handoff gates waking the blocked agent through a concrete successor todo",
346
+ },
347
+ {
348
+ "command": "python3 examples/control_plane/work-lane-contract-smoke.py",
349
+ "tier": "deep",
350
+ "reason": "covers broad work-lane policy interactions after larger refactors",
351
+ },
352
+ ],
353
+ },
354
+ {
355
+ "id": "repo-architecture-budget",
356
+ "title": "Control-plane maintainability ratchet",
357
+ "purpose": (
358
+ "Report control-plane dependency debt, oversized decision functions, and "
359
+ "compatibility facades while rejecting unreviewed debt, magnitude growth, or "
360
+ "stale exceptions. This intentionally replaces the repository-wide exact Python "
361
+ "line budget with semantic control-plane and public-facade checks."
362
+ ),
363
+ "catalog_families": ["Planning Governance", "State And Boundary"],
364
+ "trigger_hints": (
365
+ "architecture",
366
+ "architecture budget",
367
+ "maintainability",
368
+ "dependency debt",
369
+ "decision function",
370
+ "compatibility facade",
371
+ "refactor",
372
+ "quota.py",
373
+ "status.py",
374
+ "terminal_bench.py",
375
+ "skillsbench",
376
+ "loopx/",
377
+ "examples/",
378
+ "scripts/",
379
+ ),
380
+ "checks": [
381
+ {
382
+ "command": "python3 examples/control_plane/control-plane-maintainability-ratchet-smoke.py",
383
+ "tier": "default",
384
+ "reason": (
385
+ "fails on unreviewed maintainability debt or an exception whose "
386
+ "underlying debt has been retired"
387
+ ),
388
+ },
389
+ ],
390
+ },
391
+ *CONTROL_PLANE_QUALIFICATION_PROFILES,
392
+ {
393
+ "id": "status-read-path",
394
+ "title": "Status read-path contract",
395
+ "purpose": "Check scoped status reads, markdown rendering, and goal-channel status export before status/read-path changes ship.",
396
+ "catalog_families": ["Work Routing", "State And Boundary"],
397
+ "trigger_hints": (
398
+ "read-path",
399
+ "status --goal-id",
400
+ "status data",
401
+ "goal status",
402
+ "runtime handoff",
403
+ "handoff_readiness",
404
+ "post_handoff_run",
405
+ "loopx/status.py",
406
+ "loopx/cli_commands/status",
407
+ "loopx/control_plane/handoff/project_handoff.py",
408
+ ),
409
+ "checks": [
410
+ {
411
+ "command": "python3 examples/control_plane/status-goal-filter-smoke.py",
412
+ "tier": "default",
413
+ "reason": "guards scoped status projection and global default status behavior",
414
+ },
415
+ {
416
+ "command": "python3 examples/control_plane/status-quota-review-packet-parity-smoke.py",
417
+ "tier": "default",
418
+ "reason": "guards scoped status, agent quota, review-packet handoff, and scheduler_hint parity on one fixture",
419
+ },
420
+ {
421
+ "command": "python3 examples/control_plane/runtime-handoff-status-read-path-smoke.py",
422
+ "tier": "default",
423
+ "reason": (
424
+ "guards compact runtime handoff history through status, quota should-run, "
425
+ "and review-packet handoff-only read paths"
426
+ ),
427
+ },
428
+ {
429
+ "command": "python3 examples/control_plane/run-compaction-readmodel-smoke.py",
430
+ "tier": "default",
431
+ "reason": "guards status wrapper parity for compact run read-model and summary projection attachment",
432
+ },
433
+ {
434
+ "command": "python3 examples/control_plane/goal-channel-readmodel-smoke.py",
435
+ "tier": "default",
436
+ "reason": "guards status wrapper parity for goal-channel projection attachment",
437
+ },
438
+ {
439
+ "command": "python3 examples/control_plane/status-markdown-smoke.py",
440
+ "tier": "default",
441
+ "reason": "checks operator-facing markdown status rendering",
442
+ },
443
+ {
444
+ "command": "python3 examples/project/goal-channel-status-export-smoke.py",
445
+ "tier": "deep",
446
+ "reason": "guards goal-channel status export consumed by non-hot-path readers",
447
+ },
448
+ {
449
+ "command": "python3 examples/control_plane/status-quota-perf-budget-smoke.py",
450
+ "tier": "deep",
451
+ "reason": "runs the broader status/quota performance budget sample when explicitly requested",
452
+ },
453
+ ],
454
+ },
455
+ {
456
+ "id": "status-projection-cache",
457
+ "title": "Status projection cache contract",
458
+ "purpose": (
459
+ "Check opt-in status projection cache freshness, expiration fallback, "
460
+ "and quota next-action isolation before cache-path changes ship."
461
+ ),
462
+ "catalog_families": ["Work Routing", "State And Boundary"],
463
+ "trigger_hints": (
464
+ "projection-cache",
465
+ "status_projection_cache",
466
+ "use-projection-cache",
467
+ "write-projection-cache",
468
+ "status projection cache",
469
+ "loopx/control_plane/runtime/status_projection_cache.py",
470
+ "examples/control_plane/status-projection-cache-smoke.py",
471
+ ),
472
+ "checks": [
473
+ {
474
+ "command": "python3 examples/control_plane/status-projection-cache-smoke.py",
475
+ "tier": "default",
476
+ "reason": (
477
+ "guards opt-in status projection cache freshness, expiration fallback, "
478
+ "and quota next-action read-path isolation"
479
+ ),
480
+ },
481
+ ],
482
+ },
483
+ {
484
+ "id": "review-packet-read-path",
485
+ "title": "Review-packet read-path contract",
486
+ "purpose": "Check operator review packets, handoff-only payloads, and task-graph lineage before review-packet/read-path changes ship.",
487
+ "catalog_families": ["Work Routing", "Human Decision", "State And Boundary"],
488
+ "trigger_hints": (
489
+ "review-packet",
490
+ "review packet",
491
+ "handoff-only",
492
+ "project-agent handoff",
493
+ "operator packet",
494
+ "loopx/review_packet.py",
495
+ "loopx/cli_commands/status",
496
+ "docs/status-data-contract.md",
497
+ ),
498
+ "checks": [
499
+ {
500
+ "command": "python3 examples/control_plane/review-packet-cli-smoke.py",
501
+ "tier": "default",
502
+ "reason": "guards CLI-visible review-packet and handoff-only JSON contracts",
503
+ },
504
+ {
505
+ "command": "python3 examples/control_plane/review-packet-smoke.py",
506
+ "tier": "default",
507
+ "reason": "checks dashboard/operator packet copy and public-safe handoff text",
508
+ },
509
+ {
510
+ "command": "python3 examples/control_plane/task-graph-projection-fixture-smoke.py",
511
+ "tier": "default",
512
+ "reason": "guards task-graph lineage consumed by review packets without private sources",
513
+ },
514
+ {
515
+ "command": "python3 examples/control_plane/control-plane-integrated-canary-smoke.py",
516
+ "tier": "deep",
517
+ "reason": "samples the bounded status -> quota -> review-packet event read path",
518
+ },
519
+ {
520
+ "command": "python3 examples/control_plane/hot-path-interface-budget-smoke.py",
521
+ "tier": "deep",
522
+ "reason": "checks review-packet handoff interface budgets after hot-path changes",
523
+ },
524
+ ],
525
+ },
526
+ {
527
+ "id": "event-sourced-read-path",
528
+ "title": "Event-sourced read-path contract",
529
+ "purpose": "Check event projection, status read path, downstream read surfaces, and migration gates before event-store/read-path changes ship.",
530
+ "catalog_families": ["Work Routing", "State And Boundary", "Planning Governance"],
531
+ "trigger_hints": (
532
+ "event-sourced",
533
+ "event sourced",
534
+ "event projection",
535
+ "event read-path",
536
+ "downstream read",
537
+ "event-store",
538
+ "event store",
539
+ "loopx/event_sourced_state.py",
540
+ "loopx/rollout_event_log.py",
541
+ "docs/reference/protocols/event-store-migration-bridge-v0.md",
542
+ ),
543
+ "checks": [
544
+ {
545
+ "command": "python3 examples/control_plane/event-sourced-state-api-smoke.py",
546
+ "tier": "default",
547
+ "reason": "guards event append/replay API behavior used by read-path projections",
548
+ },
549
+ {
550
+ "command": "python3 examples/control_plane/event-sourced-status-read-path-smoke.py",
551
+ "tier": "default",
552
+ "reason": "checks status consumption of event projection with Markdown fallback",
553
+ },
554
+ {
555
+ "command": "python3 examples/control_plane/event-sourced-downstream-read-path-smoke.py",
556
+ "tier": "default",
557
+ "reason": "checks downstream read surfaces consume event projection without private state",
558
+ },
559
+ {
560
+ "command": "python3 examples/control_plane/event-store-migration-bridge-smoke.py",
561
+ "tier": "deep",
562
+ "reason": "samples the migration bridge gates before bounded event read-path canaries",
563
+ },
564
+ {
565
+ "command": "python3 examples/control_plane/event-sourced-replay-compaction-smoke.py",
566
+ "tier": "deep",
567
+ "reason": "checks replay compaction when broader event-store changes are promoted",
568
+ },
569
+ ],
570
+ },
571
+ {
572
+ "id": "cli-command-contract",
573
+ "title": "CLI command module contract",
574
+ "purpose": "Check command-module boundaries, ownership budgets, and compatibility for LoopX CLI refactors.",
575
+ "catalog_families": ["State And Boundary", "Planning Governance"],
576
+ "trigger_hints": (
577
+ "loopx/cli.py",
578
+ "loopx/cli_commands",
579
+ "cli command",
580
+ "command modularization",
581
+ "command-module",
582
+ ),
583
+ "checks": [
584
+ {
585
+ "command": "python3 examples/cli-version-command-modularization-smoke.py",
586
+ "tier": "default",
587
+ "reason": "guards a low-risk command migration plus old version invocations",
588
+ },
589
+ {
590
+ "command": "python3 examples/cli-control-plane-command-modularization-smoke.py",
591
+ "tier": "default",
592
+ "reason": "samples todo/quota command compatibility after CLI command refactors",
593
+ },
594
+ ],
595
+ },
596
+ {
597
+ "id": "todo-lifecycle",
598
+ "title": "Todo lifecycle contract",
599
+ "purpose": "Check todo metadata, lifecycle transitions, and event/list projection before todo read/write CLI changes ship.",
600
+ "catalog_families": ["State And Boundary", "Human Decision", "Planning Governance"],
601
+ "trigger_hints": (
602
+ "todo lifecycle",
603
+ "todo claim",
604
+ "todo list",
605
+ "todo complete",
606
+ "todo supersede",
607
+ "todo metadata",
608
+ "todo detail",
609
+ "loopx/todos.py",
610
+ "loopx/control_plane/todos/contract.py",
611
+ "loopx/control_plane/todos/decision_scope.py",
612
+ "loopx/cli_commands/todo",
613
+ ),
614
+ "checks": [
615
+ {
616
+ "command": "python3 examples/control_plane/todo-contract-smoke.py",
617
+ "tier": "default",
618
+ "reason": "guards the public todo status and metadata helper contract",
619
+ },
620
+ {
621
+ "command": "python3 examples/control_plane/todo-cli-smoke.py",
622
+ "tier": "default",
623
+ "reason": "checks agent-facing todo add/update/list behavior on fixture state",
624
+ },
625
+ {
626
+ "command": "python3 examples/control_plane/todo-lifecycle-cli-smoke.py",
627
+ "tier": "default",
628
+ "reason": "exercises claim, completion, successor, and handoff lifecycle transitions by todo_id",
629
+ },
630
+ {
631
+ "command": "python3 examples/control_plane/todo-deferred-capacity-cli-smoke.py",
632
+ "tier": "default",
633
+ "reason": "guards deferred writes, fail-closed resume kinds, and runtime capacity resume routing",
634
+ },
635
+ {
636
+ "command": "python3 examples/control_plane/todo-list-event-projection-smoke.py",
637
+ "tier": "default",
638
+ "reason": "guards event-sourced todo list projection with Markdown fallback",
639
+ },
640
+ {
641
+ "command": "python3 examples/control_plane/todo-concurrent-write-lock-smoke.py",
642
+ "tier": "deep",
643
+ "reason": "samples lock behavior for concurrent todo writes",
644
+ },
645
+ {
646
+ "command": "python3 examples/control_plane/todo-detail-cold-path-contract-smoke.py",
647
+ "tier": "deep",
648
+ "reason": "checks the cold-path todo detail contract when detail surfaces are promoted",
649
+ },
650
+ ],
651
+ },
652
+ {
653
+ "id": "monitor-scheduler",
654
+ "title": "Monitor scheduler routing",
655
+ "purpose": "Check monitor due/quiet/replan behavior without polling external targets by default.",
656
+ "catalog_families": ["Work Routing", "Planning Governance"],
657
+ "trigger_hints": ("monitor", "scheduler", "next_due_at", "monitor-poll", "continuous_monitor"),
658
+ "checks": [
659
+ {
660
+ "command": "python3 examples/control_plane/monitor-scheduler-contract-smoke.py",
661
+ "tier": "default",
662
+ "reason": "checks due monitor selection, expiry, and priority behavior",
663
+ },
664
+ {
665
+ "command": "python3 examples/control_plane/monitor-poll-writeback-smoke.py",
666
+ "tier": "default",
667
+ "reason": "guards no-spend monitor poll writeback and replan triggers",
668
+ },
669
+ {
670
+ "command": "python3 examples/control_plane/heartbeat-quota-flow-smoke.py",
671
+ "tier": "deep",
672
+ "reason": "runs a broader heartbeat/quota control-flow sample",
673
+ },
674
+ ],
675
+ },
676
+ {
677
+ "id": "state-write-correctness",
678
+ "title": "State write correctness",
679
+ "quality_risk": "high",
680
+ "purpose": "Check local state writes, refresh-state, and todo write paths before touching writer internals.",
681
+ "catalog_families": ["State And Boundary", "Planning Governance", "Human Decision"],
682
+ "trigger_hints": ("state write", "refresh-state", "todo write", "idempotency", "revision", "lease"),
683
+ "checks": [
684
+ {
685
+ "command": "python3 examples/control_plane/task-lease-runtime-smoke.py",
686
+ "tier": "default",
687
+ "reason": "guards shipped task_lease_v0 CLI/runtime ownership, TTL, conflict, transfer, and release behavior",
688
+ },
689
+ {
690
+ "command": "python3 examples/control_plane/local-state-write-correctness-contract-smoke.py",
691
+ "tier": "default",
692
+ "reason": "checks local state write correctness contract fixtures",
693
+ },
694
+ {
695
+ "command": "python3 examples/control_plane/refresh-state-write-correctness-smoke.py",
696
+ "tier": "default",
697
+ "reason": "guards refresh-state update behavior and projection writes",
698
+ },
699
+ {
700
+ "command": "python3 examples/control_plane/todo-write-correctness-smoke.py",
701
+ "tier": "default",
702
+ "reason": "guards todo dry-run write correctness and shadow revision/lease validation",
703
+ },
704
+ {
705
+ "command": "python3 examples/control_plane/todo-concurrent-write-lock-smoke.py",
706
+ "tier": "deep",
707
+ "reason": "samples lock behavior for concurrent todo writes",
708
+ },
709
+ ],
710
+ },
711
+ {
712
+ "id": "product-entry-workflows",
713
+ "title": "Product entry workflows",
714
+ "purpose": (
715
+ "Check user-facing product entry routes for issue-fix, content-ops, "
716
+ "update notes, and cross-runtime demo surfaces without reading private sources."
717
+ ),
718
+ "catalog_families": ["Human Decision", "Evidence Lifecycle", "State And Boundary", "Work Routing"],
719
+ "trigger_hints": (
720
+ "product-entry",
721
+ "product entry",
722
+ "issue-fix",
723
+ "issue fix",
724
+ "content-ops",
725
+ "content ops",
726
+ "update-note",
727
+ "update note",
728
+ "update-notes",
729
+ "update notes",
730
+ "cross-runtime",
731
+ "impl-review",
732
+ "claude implements",
733
+ "codex reviews",
734
+ "README.md",
735
+ "docs/product/use-cases/cross-runtime/cross-runtime-impl-review-demo.md",
736
+ "docs/capabilities/issue-fix",
737
+ "docs/capabilities/content-ops",
738
+ "docs/update-notes",
739
+ "loopx/capabilities/issue_fix",
740
+ "loopx/capabilities/content_ops",
741
+ "loopx/cli_commands/issue_fix",
742
+ "loopx/cli_commands/content_ops",
743
+ "scripts/update_notes_release_job.py",
744
+ ),
745
+ "checks": [
746
+ {
747
+ "command": "python3 examples/issue-fix-workflow-contract-smoke.py",
748
+ "tier": "default",
749
+ "reason": "guards the public issue-fix workflow contract, gated metadata preview, and todo writeback preview",
750
+ },
751
+ {
752
+ "command": "python3 examples/issue-fix-repository-context-smoke.py",
753
+ "tier": "default",
754
+ "reason": "guards provenance-aware repository context, advisory experts, and feasibility domain-state integration",
755
+ },
756
+ {
757
+ "command": "python3 examples/issue-fix-feasibility-smoke.py",
758
+ "tier": "default",
759
+ "reason": "guards single-route feasibility decisions and compact issue_fix domain-state writeback",
760
+ },
761
+ {
762
+ "command": "python3 examples/issue-fix-pr-lifecycle-smoke.py",
763
+ "tier": "default",
764
+ "reason": "guards PR lifecycle transitions, terminal-state precedence, and issue_fix domain-state writeback",
765
+ },
766
+ {
767
+ "command": "python3 examples/content-ops-issue-fix-intake-smoke.py",
768
+ "tier": "default",
769
+ "reason": "checks content-ops issue-fix intake from public metadata without external reads or writes",
770
+ },
771
+ {
772
+ "command": "python3 examples/public_entry/readme-demo-surface-smoke.py",
773
+ "tier": "default",
774
+ "reason": "guards the README and cross-runtime implement/review demo entry surface",
775
+ },
776
+ {
777
+ "command": "python3 examples/update-notes-archive-smoke.py",
778
+ "tier": "default",
779
+ "reason": "checks public update-note archive, automation wiring, and private-boundary exclusions",
780
+ },
781
+ {
782
+ "command": "python3 examples/issue-fix-workflow-e2e-smoke.py",
783
+ "tier": "deep",
784
+ "reason": "runs the fuller issue-fix metadata-to-plan-to-review-packet product path",
785
+ },
786
+ {
787
+ "command": "python3 examples/issue-fix-acceptance-loop-smoke.py",
788
+ "tier": "deep",
789
+ "reason": "samples the heavier caller-repo branch and acceptance-loop fixture",
790
+ },
791
+ {
792
+ "command": "python3 examples/content-ops-private-connector-gate-smoke.py",
793
+ "tier": "deep",
794
+ "reason": "checks private connector owner-gate projection for content operations",
795
+ },
796
+ ],
797
+ },
798
+ {
799
+ "id": "issue-fix-reviewer-routing",
800
+ "title": "Issue-fix reviewer routing and bilingual guide",
801
+ "purpose": (
802
+ "Check the bilingual issue-fix product entry and explainable local "
803
+ "reviewer recommendation plus authority-gated verified notification "
804
+ "contract."
805
+ ),
806
+ "catalog_families": ["Human Decision", "Evidence Lifecycle", "State And Boundary"],
807
+ "trigger_hints": (
808
+ "reviewer-plan",
809
+ "reviewer recommendation",
810
+ "issue_fix_reviewer_recommendation",
811
+ "reviewer-request",
812
+ "issue_fix_reviewer_request",
813
+ "reviewer notification sink",
814
+ "issue_fix_reviewer_notification",
815
+ "docs/capabilities/issue-fix/README",
816
+ "docs/capabilities/issue-fix/protocols/issue-fix-reviewer-recommendation",
817
+ "examples/issue-fix-capability-guide-smoke.py",
818
+ "examples/issue-fix-reviewer-recommendation-smoke.py",
819
+ "examples/issue-fix-reviewer-request-smoke.py",
820
+ "examples/issue-fix-json-input-boundary-smoke.py",
821
+ "examples/issue-fix-reviewer-notification-sink-smoke.py",
822
+ "loopx/capabilities/issue_fix/cli.py",
823
+ "loopx/capabilities/issue_fix/reviewer_recommendation.py",
824
+ "loopx/capabilities/issue_fix/reviewer_request.py",
825
+ "loopx/capabilities/issue_fix/reviewer_notification.py",
826
+ ),
827
+ "checks": [
828
+ {
829
+ "command": "python3 examples/issue-fix-json-input-boundary-smoke.py",
830
+ "tier": "default",
831
+ "reason": "guards bounded inline issue-fix JSON inputs and compact errors that never echo raw payloads",
832
+ },
833
+ {
834
+ "command": "python3 examples/issue-fix-capability-guide-smoke.py",
835
+ "tier": "default",
836
+ "reason": "guards the bilingual issue-fix product entry, README links, reviewer protocol, and public-safe roadmap surface",
837
+ },
838
+ {
839
+ "command": "python3 examples/issue-fix-reviewer-recommendation-smoke.py",
840
+ "tier": "default",
841
+ "reason": "guards explainable CODEOWNERS and base-revision changed-path/module-history reviewer recommendations",
842
+ },
843
+ {
844
+ "command": "python3 examples/issue-fix-reviewer-request-smoke.py",
845
+ "tier": "default",
846
+ "reason": "guards author exclusion, formal-request-first notification, permission-only comment fallback, idempotency, blockers, and post-write verification",
847
+ },
848
+ {
849
+ "command": "python3 examples/issue-fix-reviewer-notification-sink-smoke.py",
850
+ "tier": "default",
851
+ "reason": "guards project-dedicated secondary notification identity, local-private mapping, idempotent send/readback, concrete gates, and public-safety redaction",
852
+ },
853
+ ],
854
+ },
855
+ {
856
+ "id": "issue-fix-outcome-visibility",
857
+ "title": "Issue-fix status and output visibility",
858
+ "purpose": (
859
+ "Check the derived issue case read model and generic Kanban projection "
860
+ "without adding a parallel issue-fix state machine."
861
+ ),
862
+ "catalog_families": ["Evidence Lifecycle", "State And Boundary", "Work Routing"],
863
+ "trigger_hints": (
864
+ "issue-fix outcome",
865
+ "issue_fix_outcome",
866
+ "outcome_projection",
867
+ "examples/issue-fix-outcome-projection-smoke.py",
868
+ "examples/issue-fix-validated-memory-writeback-smoke.py",
869
+ "loopx/capabilities/issue_fix/outcome_projection.py",
870
+ "loopx/capabilities/issue_fix/repository_memory_provider.py",
871
+ "loopx/capabilities/context_providers/service_ownership.py",
872
+ "loopx/extensions/lark/presentation/projection_rows.py",
873
+ "projection_source_reconcile",
874
+ ),
875
+ "checks": [
876
+ {
877
+ "command": "python3 examples/issue-fix-outcome-projection-smoke.py",
878
+ "tier": "default",
879
+ "reason": "guards derived issue status/output cards, truthful delivery evidence, terminal visibility, and Lark projection reuse",
880
+ },
881
+ {
882
+ "command": "python3 examples/issue-fix-validated-memory-writeback-smoke.py",
883
+ "tier": "default",
884
+ "reason": "guards explicit owner gating, validated distilled facts, idempotent provider writes, and unsafe-capture rejection",
885
+ },
886
+ {"command": "python3 examples/context-provider-service-ownership-smoke.py", "tier": "default", "reason": "guards persistent ownership, restart detection, append-attempt accounting, and public-safe receipts"},
887
+ {"command": "python3 examples/lark-projection-source-reconcile-smoke.py",
888
+ "tier": "default", "reason": "guards preview-first complete-source "
889
+ "orphan and stale-mapping reconciliation"},
890
+ ],
891
+ },
892
+ {
893
+ "id": "cross-runtime-impl-review-demo",
894
+ "title": "Cross-runtime implementation/review demo",
895
+ "purpose": (
896
+ "Check the Claude Code implementation + Codex review demo packet "
897
+ "without writing state or launching either runtime."
898
+ ),
899
+ "catalog_families": [
900
+ "Human Decision",
901
+ "Work Routing",
902
+ "Evidence Lifecycle",
903
+ "State And Boundary",
904
+ ],
905
+ "trigger_hints": (
906
+ "cross-runtime",
907
+ "impl-review",
908
+ "claude implements",
909
+ "codex reviews",
910
+ "claude-code-impl",
911
+ "codex-review",
912
+ "loopx demo impl-review",
913
+ "cross_runtime_impl_review_demo_packet_v0",
914
+ "docs/product/use-cases/cross-runtime/cross-runtime-impl-review-demo.md",
915
+ "loopx/control_plane/handoff/cross_runtime_impl_review.py",
916
+ "loopx/cli_commands/starter.py",
917
+ ),
918
+ "checks": [
919
+ {
920
+ "command": "python3 examples/cross-runtime-impl-review-demo-smoke.py",
921
+ "tier": "default",
922
+ "reason": "guards the dry-run packet, CLI route, role split, and no-write boundary",
923
+ },
924
+ {
925
+ "command": "python3 examples/public_entry/readme-demo-surface-smoke.py",
926
+ "tier": "default",
927
+ "reason": "guards the public README and product note entry points for the demo",
928
+ },
929
+ ],
930
+ },
931
+ {
932
+ "id": "host-command-entry",
933
+ "title": "Host command entry and slash-command discovery",
934
+ "purpose": (
935
+ "Check slash-command discovery, Codex App host command routing, "
936
+ "and global manager command entry surfaces without mutating project state."
937
+ ),
938
+ "catalog_families": ["Human Decision", "Work Routing", "State And Boundary"],
939
+ "trigger_hints": (
940
+ "slash-command",
941
+ "slash command",
942
+ "slash-commands",
943
+ "/loopx-global-summary",
944
+ "/loopx-global-gates",
945
+ "/loopx-global-todos",
946
+ "/loopx-global-risks",
947
+ "global-manager",
948
+ "global manager",
949
+ "host command",
950
+ "host command registry",
951
+ "codex app host command",
952
+ "docs/reference/protocols/codex-app-host-command-registry-v0.md",
953
+ "docs/reference/protocols/global-manager-command-v0.md",
954
+ "loopx/cli_commands/slash_commands.py",
955
+ "loopx/cli_commands/summary_all.py",
956
+ ),
957
+ "checks": [
958
+ {
959
+ "command": "python3 examples/slash-command-catalog-smoke.py",
960
+ "tier": "default",
961
+ "reason": "guards public slash-command discovery and legacy alias visibility",
962
+ },
963
+ {
964
+ "command": "python3 examples/codex-app-host-command-registry-smoke.py",
965
+ "tier": "default",
966
+ "reason": "guards Codex App host command routing and fail-closed slash-command help",
967
+ },
968
+ {
969
+ "command": "python3 examples/project/global-manager-command-protocol-smoke.py",
970
+ "tier": "default",
971
+ "reason": "checks read-only global manager command protocol and aliases",
972
+ },
973
+ ],
974
+ },
975
+ {
976
+ "id": "new-user-onboarding-lifecycle",
977
+ "title": "New-user onboarding lifecycle",
978
+ "quality_risk": "high",
979
+ "purpose": (
980
+ "Check fresh no-scan connection, structured todo projection, "
981
+ "state-gap detection, and domain-adapter routing ownership."
982
+ ),
983
+ "catalog_families": ["Work Routing", "State And Boundary"],
984
+ "trigger_hints": (
985
+ "new user onboarding",
986
+ "onboarding lifecycle",
987
+ "no-onboarding-scan",
988
+ "onboarding_connection_validation",
989
+ "state projection gap",
990
+ "start-goal",
991
+ "loopx/bootstrap.py",
992
+ "loopx/bootstrap_command_pack.py",
993
+ "loopx/contract.py",
994
+ "loopx/state_projection.py",
995
+ "loopx/cli_commands/bootstrap_connect.py",
996
+ "loopx/cli_commands/starter_bootstrap.py",
997
+ "loopx/cli_commands/starter_bootstrap_registration.py",
998
+ ),
999
+ "checks": [
1000
+ {
1001
+ "command": "python3 examples/project/onboarding-no-scan-projection-smoke.py",
1002
+ "tier": "default",
1003
+ "reason": (
1004
+ "guards fresh connection-to-todo parity, state-gap warnings, "
1005
+ "and domain-adapter routing ownership"
1006
+ ),
1007
+ },
1008
+ ],
1009
+ },
1010
+ {
1011
+ "id": "runtime-connector-catalog",
1012
+ "title": "Runtime connector catalog",
1013
+ "purpose": (
1014
+ "Check Codex App heartbeat, Codex CLI TUI, Claude Code loop, "
1015
+ "and worker bridge connector contracts from the public runtime catalog."
1016
+ ),
1017
+ "catalog_families": ["Work Routing", "State And Boundary", "Planning Governance"],
1018
+ "trigger_hints": (
1019
+ "runtime connector",
1020
+ "runtime connector catalog",
1021
+ "runtime-connector-catalog",
1022
+ "docs/integrations/runtime-connector-catalog.md",
1023
+ "codex app heartbeat",
1024
+ "codex_app_heartbeat",
1025
+ "codex app ssh",
1026
+ "codex_app_ssh_goal",
1027
+ "codex cli tui",
1028
+ "codex_cli_tui",
1029
+ "claude code loop",
1030
+ "claude_code_loop",
1031
+ "shell worker",
1032
+ "http webhook",
1033
+ "worker bridge",
1034
+ "worker_bridge",
1035
+ "scheduler_hint",
1036
+ "scoped identity",
1037
+ "runtime loop",
1038
+ "host runtime",
1039
+ ),
1040
+ "checks": [
1041
+ {
1042
+ "command": "python3 examples/control_plane/heartbeat-prompt-smoke.py",
1043
+ "tier": "default",
1044
+ "reason": "guards Codex App heartbeat identity, scheduler hints, and no-spend cadence behavior",
1045
+ },
1046
+ {
1047
+ "command": "python3 examples/codex-cli-tui-bootstrap-smoke-bundle-smoke.py",
1048
+ "tier": "default",
1049
+ "reason": "checks Codex CLI TUI bootstrap bundle and scoped LoopX command contract",
1050
+ },
1051
+ {
1052
+ "command": "python3 examples/claude-goalmode-lifecycle-smoke.py",
1053
+ "tier": "default",
1054
+ "reason": "checks the Claude Code goal-mode loop lifecycle without production actions",
1055
+ },
1056
+ {
1057
+ "command": "python3 examples/worker-bridge-install-contract-smoke.py",
1058
+ "tier": "default",
1059
+ "reason": "checks generic worker bridge install/status contracts without private runtime material",
1060
+ },
1061
+ {
1062
+ "command": "python3 examples/host-integration-surface-smoke.py",
1063
+ "tier": "deep",
1064
+ "reason": "samples the broader host integration surface when connector catalog changes are promoted",
1065
+ },
1066
+ ],
1067
+ },
1068
+ {
1069
+ "id": "frontstage-rollout",
1070
+ "title": "Frontstage rollout projection",
1071
+ "purpose": "Check public frontstage/showcase projection data before visual browser smokes.",
1072
+ "catalog_families": ["State And Boundary", "Evidence Lifecycle", "Human Decision"],
1073
+ "trigger_hints": ("frontstage", "showcase", "rollout", "dashboard", "visual"),
1074
+ "checks": [
1075
+ {
1076
+ "command": "python3 examples/frontstage-rollout-projections-fixture-smoke.py",
1077
+ "tier": "default",
1078
+ "reason": "checks reusable frontstage rollout projection fixtures",
1079
+ },
1080
+ {
1081
+ "command": "python3 examples/showcase-animation-prototype-smoke.py",
1082
+ "tier": "default",
1083
+ "reason": "guards showcase animation projection data without a browser",
1084
+ },
1085
+ {
1086
+ "command": "node examples/dashboard-frontstage-browser-smoke.mjs",
1087
+ "tier": "deep",
1088
+ "reason": "runs browser-level visual route validation when UI is promoted",
1089
+ },
1090
+ ],
1091
+ },
1092
+ {
1093
+ "id": "auto-research-demo",
1094
+ "title": "Auto-research demo and frontier route",
1095
+ "purpose": (
1096
+ "Check the minimal auto-research kernel and shared frontier projection; "
1097
+ "keep legacy visible/demo wrappers out of the default canary path."
1098
+ ),
1099
+ "catalog_families": ["Work Routing", "Evidence Lifecycle", "State And Boundary", "Human Decision"],
1100
+ "trigger_hints": (
1101
+ "auto-research",
1102
+ "auto research",
1103
+ "demo-supervisor",
1104
+ "demo e2e",
1105
+ "frontier",
1106
+ "visible launcher",
1107
+ "loopx/capabilities/auto_research",
1108
+ "loopx/cli_commands/auto_research",
1109
+ ),
1110
+ "checks": [
1111
+ {
1112
+ "command": "python3 examples/auto-research-minimal-kernel-smoke.py",
1113
+ "tier": "default",
1114
+ "reason": "checks the minimal evaluator-agnostic kernel and rejects public shortcut replay paths",
1115
+ },
1116
+ {
1117
+ "command": "python3 examples/decentralized-auto-research-frontier-smoke.py",
1118
+ "tier": "default",
1119
+ "reason": "checks shared frontier, evidence graph, and public boundary fixtures",
1120
+ },
1121
+ {
1122
+ "command": "python3 examples/auto-research-demo-supervisor-smoke.py",
1123
+ "tier": "deep",
1124
+ "reason": "samples the full dry-run supervisor packet and lane bootstrap contract",
1125
+ },
1126
+ {
1127
+ "command": "python3 examples/auto-research-rollout-readpath-smoke.py",
1128
+ "tier": "deep",
1129
+ "reason": "checks rollout event read-path projection into live evidence graphs",
1130
+ },
1131
+ {
1132
+ "command": "python3 examples/auto-research-live-evidence-capture-smoke.py",
1133
+ "tier": "deep",
1134
+ "reason": "checks compact live evidence capture fixtures for visible lanes",
1135
+ },
1136
+ ],
1137
+ },
1138
+ {
1139
+ "id": "explore-harness",
1140
+ "title": "Explore Harness configuration and runtime",
1141
+ "purpose": (
1142
+ "Check the deny-by-default goal boundary, planner agreement, resumable "
1143
+ "runtime state, and per-item failure isolation."
1144
+ ),
1145
+ "catalog_families": ["Work Routing", "State And Boundary", "Evidence Lifecycle"],
1146
+ "trigger_hints": (
1147
+ "explore harness",
1148
+ "explore-harness",
1149
+ "harness_runtime",
1150
+ "harness_checkpoint",
1151
+ "explore_harness",
1152
+ "loopx/capabilities/explore",
1153
+ "docs/capabilities/explore",
1154
+ "examples/explore-configure-goal-smoke.py",
1155
+ "examples/explore-harness-runtime-resume-smoke.py",
1156
+ ),
1157
+ "checks": [
1158
+ {
1159
+ "command": "python3 examples/explore-configure-goal-smoke.py",
1160
+ "tier": "default",
1161
+ "reason": "guards configure-goal opt-in and quota/planner boundary agreement",
1162
+ },
1163
+ {
1164
+ "command": "python3 examples/explore-harness-runtime-resume-smoke.py",
1165
+ "tier": "default",
1166
+ "reason": "guards validated resume state, novelty/variant restoration, and item failure isolation",
1167
+ },
1168
+ {
1169
+ "command": "python3 examples/explore-worker-plan-gate-smoke.py",
1170
+ "tier": "default",
1171
+ "reason": "guards profile pinning, analysis-only planning, and lane-width authority",
1172
+ },
1173
+ {
1174
+ "command": "python3 examples/explore-result-layer-smoke.py",
1175
+ "tier": "deep",
1176
+ "reason": "samples the wider Explore result and presentation contract",
1177
+ },
1178
+ ],
1179
+ },
1180
+ {
1181
+ "id": "peer-agent-runtime",
1182
+ "title": "Peer agent runtime and migration",
1183
+ "quality_risk": "high",
1184
+ "purpose": (
1185
+ "Check equal peer identity, deterministic task assignment, task-policy "
1186
+ "completion, symmetric workspace isolation, task-scoped coordination, "
1187
+ "and atomic registry/heartbeat migration."
1188
+ ),
1189
+ "catalog_families": ["Work Routing", "State And Boundary", "Evidence Lifecycle"],
1190
+ "trigger_hints": (
1191
+ "peer agent",
1192
+ "peer-agent",
1193
+ "peer_v1",
1194
+ "agent_model",
1195
+ "excluded_agents",
1196
+ "task_orchestration_contract",
1197
+ "agent_workspace_guard",
1198
+ "loopx/control_plane/quota/slot_accounting.py",
1199
+ "loopx/control_plane/agents",
1200
+ "loopx/control_plane/todos/completion_policy.py",
1201
+ "loopx/control_plane/quota/task_orchestration.py",
1202
+ "loopx/control_plane/goals/configure_goal_service.py",
1203
+ "loopx/heartbeat_prompt.py",
1204
+ "loopx/configure_goal.py",
1205
+ "examples/project/configure-goal-global-sync-smoke.py",
1206
+ ),
1207
+ "checks": [
1208
+ {
1209
+ "command": "python3 examples/project/configure-goal-global-sync-smoke.py",
1210
+ "tier": "default",
1211
+ "reason": "guards authoritative split-runtime configure-goal sync, explicit overrides, and exact readback",
1212
+ },
1213
+ {
1214
+ "command": "python3 examples/control_plane/peer-agent-runtime-v1-smoke.py",
1215
+ "tier": "default",
1216
+ "reason": "guards the complete peer identity, routing, completion, workspace, orchestration, migration, and host-loop contract",
1217
+ },
1218
+ {
1219
+ "command": "python3 examples/control_plane/agent-identity-readmodel-smoke.py",
1220
+ "tier": "deep",
1221
+ "reason": "guards rank-free peer identity and deterministic assignment",
1222
+ },
1223
+ {
1224
+ "command": "python3 examples/control_plane/quota-replan-decision-plane-smoke.py",
1225
+ "tier": "deep",
1226
+ "reason": "guards exactly-one peer ownership for unscoped replans",
1227
+ },
1228
+ {
1229
+ "command": "python3 examples/control_plane/todo-continuation-policy-smoke.py",
1230
+ "tier": "deep",
1231
+ "reason": "guards task-policy completion and independent review handoff",
1232
+ },
1233
+ {
1234
+ "command": "python3 examples/control_plane/peer-agent-migration-smoke.py",
1235
+ "tier": "deep",
1236
+ "reason": "guards atomic registry backup/cutover and peer heartbeat prompts",
1237
+ },
1238
+ {
1239
+ "command": "python3 examples/control_plane/peer-agent-workspace-guard-smoke.py",
1240
+ "tier": "deep",
1241
+ "reason": "guards symmetric write-aware worktree isolation in real git worktrees",
1242
+ },
1243
+ {
1244
+ "command": "python3 examples/control_plane/quota-spend-workspace-causality-smoke.py",
1245
+ "tier": "deep",
1246
+ "reason": "binds post-completion quota spend to the accountable delivery repository without weakening cross-repo isolation",
1247
+ },
1248
+ {
1249
+ "command": "python3 examples/control_plane/task-orchestration-smoke.py",
1250
+ "tier": "deep",
1251
+ "reason": "guards deterministic task-scoped coordination without durable leader authority",
1252
+ },
1253
+ {
1254
+ "command": "python3 examples/control_plane/agent-onboard-host-loop-activation-smoke.py",
1255
+ "tier": "deep",
1256
+ "reason": "guards rank-free host-loop identity selection and regeneration",
1257
+ },
1258
+ ],
1259
+ },
1260
+ {
1261
+ "id": "catalog-canary-contract",
1262
+ "title": "Catalog canary contract",
1263
+ "purpose": "Check catalog-to-canary planning, JSON actionability, shell-free no-write execution, and full/module smoke-suite selection.",
1264
+ "catalog_families": ["Planning Governance", "State And Boundary", "Work Routing"],
1265
+ "trigger_hints": (
1266
+ "catalog canary", "canary planner", "canary runner", "canary plan", "canary run",
1267
+ "smoke-suite", "run-smokes", "full smoke", "loopx/canary", "loopx/cli_commands/canary.py",
1268
+ "examples/canary/catalog", "examples/run-smokes.py",
1269
+ ),
1270
+ "checks": [
1271
+ {
1272
+ "command": "python3 examples/canary/catalog-planner-smoke.py",
1273
+ "tier": "default",
1274
+ "reason": "guards catalog coverage, selector routing, and actionable JSON plan commands",
1275
+ },
1276
+ {
1277
+ "command": "python3 examples/canary/catalog-run-e2e-smoke.py",
1278
+ "tier": "default",
1279
+ "reason": "guards shell-free no-write canary execution from the selected catalog plan",
1280
+ },
1281
+ {
1282
+ "command": "python3 examples/canary/smoke-suite-runner-smoke.py",
1283
+ "tier": "default",
1284
+ "reason": "guards full-public, module-filtered, and catalog-profile smoke-suite selection",
1285
+ },
1286
+ {
1287
+ "command": "python3 examples/canary/pytest-smoke-suite-facade-smoke.py",
1288
+ "tier": "deep",
1289
+ "reason": "guards optional pytest/JUnit reporting while keeping canary smoke-suite as source of truth",
1290
+ },
1291
+ {
1292
+ "command": "python3 examples/canary/quality-surface-catalog-smoke.py",
1293
+ "tier": "deep",
1294
+ "reason": "guards high-risk surface classification, independent semantic oracles, and explicit quality-layer gaps",
1295
+ },
1296
+ ],
1297
+ },
1298
+ {
1299
+ "id": "benchmark-adapter-readiness",
1300
+ "title": "Benchmark adapter readiness",
1301
+ "purpose": "Check public adapter contracts and evidence boundaries without launching benchmark jobs by default.",
1302
+ "catalog_families": ["Evidence Lifecycle", "State And Boundary", "Work Routing"],
1303
+ "trigger_hints": (
1304
+ "benchmark",
1305
+ "benchmark adapter",
1306
+ "benchmark runner",
1307
+ "benchmark ledger",
1308
+ "skillsbench",
1309
+ "terminal-bench",
1310
+ "loopx/benchmark",
1311
+ "loopx/benchmark_case_state.py",
1312
+ "examples/benchmark",
1313
+ ),
1314
+ "checks": [
1315
+ {
1316
+ "command": "python3 examples/terminal-bench-adapter-readiness-characterization-smoke.py",
1317
+ "tier": "default",
1318
+ "reason": (
1319
+ "characterizes Terminal-Bench preflight, no-submit boundary, "
1320
+ "CLI bridge/access packet, and benchmark_run builders without "
1321
+ "launching benchmark jobs"
1322
+ ),
1323
+ },
1324
+ {
1325
+ "command": "python3 examples/benchmark-core-adapter-contract-smoke.py",
1326
+ "tier": "default",
1327
+ "reason": "checks shared benchmark adapter contract behavior",
1328
+ },
1329
+ {
1330
+ "command": "python3 examples/benchmark-artifact-path-filter-smoke.py",
1331
+ "tier": "default",
1332
+ "reason": "guards raw/private benchmark artifact path exclusion",
1333
+ },
1334
+ {
1335
+ "command": "python3 examples/skillsbench-benchmark-run-smoke.py",
1336
+ "tier": "deep",
1337
+ "reason": "runs the heavier SkillsBench integration smoke only when explicitly requested",
1338
+ },
1339
+ ],
1340
+ },
1341
+ )
1342
+
1343
+
1344
+ def _quality_audit_source_root(candidate: Path | None) -> Path | None:
1345
+ source_root = (candidate or REPO_ROOT).resolve()
1346
+ required_paths = (
1347
+ source_root / "pyproject.toml",
1348
+ source_root / "loopx" / "canary" / "quality_surface_catalog.py",
1349
+ source_root / "tests" / "canary" / "test_quality_surface_catalog.py",
1350
+ )
1351
+ return source_root if all(path.is_file() for path in required_paths) else None
1352
+
1353
+
1354
+ def build_quality_surface_catalog_audit(
1355
+ *,
1356
+ repo_root: Path | None = None,
1357
+ ) -> dict[str, Any]:
1358
+ """Audit quality-layer ownership for every high-risk canary profile."""
1359
+
1360
+ return _build_quality_surface_catalog_audit(
1361
+ CURRENT_REPO_PROFILES,
1362
+ repo_root=_quality_audit_source_root(repo_root),
1363
+ )
1364
+
1365
+
1366
+ def _slug(value: str) -> str:
1367
+ return re.sub(r"[^a-z0-9]+", "-", value.lower()).strip("-")
1368
+
1369
+
1370
+ def _catalog_profile_id(profile: dict[str, Any]) -> str:
1371
+ return _slug(str(profile.get("id") or profile.get("family") or ""))
1372
+
1373
+
1374
+ def _split_table_row(line: str) -> list[str]:
1375
+ return [cell.strip() for cell in line.strip().strip("|").split("|")]
1376
+
1377
+
1378
+ def _parse_markdown_table(lines: list[str]) -> list[dict[str, str]]:
1379
+ rows = [_split_table_row(line) for line in lines if line.strip().startswith("|")]
1380
+ if len(rows) < 3:
1381
+ return []
1382
+ headers = rows[0]
1383
+ parsed: list[dict[str, str]] = []
1384
+ for row in rows[2:]:
1385
+ if len(row) != len(headers):
1386
+ continue
1387
+ parsed.append({headers[index]: value for index, value in enumerate(row)})
1388
+ return parsed
1389
+
1390
+
1391
+ def _first_table_after(text: str, marker: str) -> list[dict[str, str]]:
1392
+ index = text.find(marker)
1393
+ if index < 0:
1394
+ return []
1395
+ table_lines: list[str] = []
1396
+ in_table = False
1397
+ for line in text[index:].splitlines():
1398
+ if line.strip().startswith("|"):
1399
+ table_lines.append(line)
1400
+ in_table = True
1401
+ elif in_table:
1402
+ break
1403
+ return _parse_markdown_table(table_lines)
1404
+
1405
+
1406
+ def _pattern_ids(value: str) -> list[str]:
1407
+ return sorted(set(re.findall(r"\bIP-\d{3}\b", value)))
1408
+
1409
+
1410
+ def _split_semicolon(value: str) -> list[str]:
1411
+ return [item.strip() for item in value.split(";") if item.strip()]
1412
+
1413
+
1414
+ def _read_catalog(catalog_path: Path | None = None) -> tuple[Path, str]:
1415
+ path = (catalog_path or DEFAULT_CATALOG_PATH).expanduser()
1416
+ return path, path.read_text(encoding="utf-8")
1417
+
1418
+
1419
+ def _display_path(path: Path) -> str:
1420
+ try:
1421
+ return str(path.relative_to(REPO_ROOT))
1422
+ except ValueError:
1423
+ return str(path)
1424
+
1425
+
1426
+ def build_catalog_canary_profiles(catalog_path: Path | None = None) -> dict[str, Any]:
1427
+ path, text = _read_catalog(catalog_path)
1428
+ archetype_rows = _first_table_after(text, "| Canary Archetype |")
1429
+ family_rows = _first_table_after(text, "| Family |")
1430
+
1431
+ archetypes = []
1432
+ for row in archetype_rows:
1433
+ name = row.get("Canary Archetype", "")
1434
+ archetypes.append(
1435
+ {
1436
+ "id": _slug(name),
1437
+ "name": name,
1438
+ "primary_question": row.get("Primary Question", ""),
1439
+ "trigger_surface": row.get("Typical Trigger Surface", ""),
1440
+ "fixture_depth": row.get("Fixture Depth", ""),
1441
+ "cost_tier": row.get("Cost Tier", ""),
1442
+ "failure_meaning": row.get("Failure Usually Means", ""),
1443
+ }
1444
+ )
1445
+
1446
+ profiles = []
1447
+ for row in family_rows:
1448
+ family = row.get("Family", "")
1449
+ archetype_names = _split_semicolon(row.get("Default Canary Archetypes", ""))
1450
+ profiles.append(
1451
+ {
1452
+ "schema_version": CANARY_PROFILE_SCHEMA_VERSION,
1453
+ "id": _slug(family),
1454
+ "family": family,
1455
+ "pattern_ids": _pattern_ids(row.get("P0/P1 Pattern Coverage", "")),
1456
+ "default_archetypes": [
1457
+ {
1458
+ "id": _slug(name),
1459
+ "name": name,
1460
+ }
1461
+ for name in archetype_names
1462
+ ],
1463
+ "trigger_surfaces": row.get("Trigger Surfaces", ""),
1464
+ "minimum_useful_fixture": row.get("Minimum Useful Fixture", ""),
1465
+ "failure_meaning": row.get("Failure Meaning", ""),
1466
+ "candidate_checks": FAMILY_CHECKS.get(family, []),
1467
+ }
1468
+ )
1469
+
1470
+ domain_profiles = []
1471
+ for profile in CURRENT_REPO_PROFILES:
1472
+ domain_profiles.append(
1473
+ {
1474
+ "schema_version": CANARY_DOMAIN_PROFILE_SCHEMA_VERSION,
1475
+ **profile,
1476
+ "checks": list(profile.get("checks", [])),
1477
+ }
1478
+ )
1479
+
1480
+ return {
1481
+ "ok": bool(archetypes and profiles),
1482
+ "schema_version": CANARY_PROFILES_SCHEMA_VERSION,
1483
+ "source": _display_path(path),
1484
+ "dry_run": True,
1485
+ "executes_checks": False,
1486
+ "archetype_count": len(archetypes),
1487
+ "profile_count": len(profiles),
1488
+ "domain_profile_count": len(domain_profiles),
1489
+ "archetypes": archetypes,
1490
+ "profiles": profiles,
1491
+ "domain_profiles": domain_profiles,
1492
+ }
1493
+
1494
+
1495
+ def _catalog_pattern_rows(text: str) -> list[dict[str, str]]:
1496
+ rows: list[dict[str, str]] = []
1497
+ for line in text.splitlines():
1498
+ if not line.strip().startswith("|"):
1499
+ continue
1500
+ cells = _split_table_row(line)
1501
+ if len(cells) < 3:
1502
+ continue
1503
+ if cells[0] not in {"P0", "P1", "P2"} or not re.fullmatch(r"IP-\d{3}", cells[1]):
1504
+ continue
1505
+ rows.append(
1506
+ {
1507
+ "importance": cells[0],
1508
+ "pattern_id": cells[1],
1509
+ "name": cells[2],
1510
+ }
1511
+ )
1512
+ return rows
1513
+
1514
+
1515
+ def _coverage_exception_rows(text: str) -> dict[str, dict[str, str]]:
1516
+ table = _first_table_after(text, "| Pattern ID | Canary Coverage Status |")
1517
+ exceptions: dict[str, dict[str, str]] = {}
1518
+ for row in table:
1519
+ pattern_id = next(iter(_pattern_ids(row.get("Pattern ID", ""))), "")
1520
+ if not pattern_id:
1521
+ continue
1522
+ status = _slug(row.get("Canary Coverage Status", ""))
1523
+ if status not in {"non-applicable", "not-applicable", "deferred"}:
1524
+ continue
1525
+ exceptions[pattern_id] = {
1526
+ "pattern_id": pattern_id,
1527
+ "status": "non-applicable" if status == "not-applicable" else status,
1528
+ "rationale": row.get("Rationale", ""),
1529
+ "owner": row.get("Owner", ""),
1530
+ }
1531
+ return exceptions
1532
+
1533
+
1534
+ def _coverage_exception_is_valid(exception: dict[str, str]) -> bool:
1535
+ status = exception.get("status")
1536
+ rationale = bool(str(exception.get("rationale") or "").strip())
1537
+ owner = bool(str(exception.get("owner") or "").strip())
1538
+ if status == "non-applicable":
1539
+ return rationale
1540
+ if status == "deferred":
1541
+ return rationale and owner
1542
+ return False
1543
+
1544
+
1545
+ def build_catalog_canary_coverage_audit(
1546
+ *,
1547
+ catalog_path: Path | None = None,
1548
+ priorities: list[str] | None = None,
1549
+ ) -> dict[str, Any]:
1550
+ path, text = _read_catalog(catalog_path)
1551
+ profile_packet = build_catalog_canary_profiles(catalog_path)
1552
+ required_priorities = tuple(priorities or ["P0", "P1"])
1553
+ pattern_rows = [
1554
+ row
1555
+ for row in _catalog_pattern_rows(text)
1556
+ if row.get("importance") in required_priorities
1557
+ ]
1558
+ profile_coverage: dict[str, list[str]] = {}
1559
+ for profile in profile_packet.get("profiles", []):
1560
+ if not isinstance(profile, dict):
1561
+ continue
1562
+ profile_id = str(profile.get("id") or "")
1563
+ for pattern_id in profile.get("pattern_ids", []):
1564
+ if isinstance(pattern_id, str):
1565
+ profile_coverage.setdefault(pattern_id, []).append(profile_id)
1566
+ exceptions = _coverage_exception_rows(text)
1567
+
1568
+ covered: list[dict[str, Any]] = []
1569
+ excepted: list[dict[str, Any]] = []
1570
+ missing: list[dict[str, Any]] = []
1571
+ invalid_exceptions: list[dict[str, Any]] = []
1572
+ for row in pattern_rows:
1573
+ pattern_id = row["pattern_id"]
1574
+ profile_ids = profile_coverage.get(pattern_id, [])
1575
+ if profile_ids:
1576
+ covered.append({**row, "profile_ids": profile_ids})
1577
+ continue
1578
+ exception = exceptions.get(pattern_id)
1579
+ if exception and _coverage_exception_is_valid(exception):
1580
+ excepted.append({**row, **exception})
1581
+ continue
1582
+ if exception:
1583
+ invalid_exceptions.append({**row, **exception})
1584
+ else:
1585
+ missing.append(row)
1586
+
1587
+ drift_count = len(missing) + len(invalid_exceptions)
1588
+ return {
1589
+ "ok": bool(profile_packet.get("ok")) and drift_count == 0,
1590
+ "schema_version": CANARY_COVERAGE_AUDIT_SCHEMA_VERSION,
1591
+ "source": _display_path(path),
1592
+ "dry_run": True,
1593
+ "executes_checks": False,
1594
+ "priorities": list(required_priorities),
1595
+ "required_pattern_count": len(pattern_rows),
1596
+ "covered_count": len(covered),
1597
+ "excepted_count": len(excepted),
1598
+ "missing_count": len(missing),
1599
+ "invalid_exception_count": len(invalid_exceptions),
1600
+ "drift_count": drift_count,
1601
+ "covered_patterns": covered,
1602
+ "excepted_patterns": excepted,
1603
+ "missing_patterns": missing,
1604
+ "invalid_exceptions": invalid_exceptions,
1605
+ "note": (
1606
+ "Coverage means each selected catalog pattern is listed in a canary "
1607
+ "family profile, or has an explicit non-applicable rationale or "
1608
+ "deferred owner in a catalog coverage exception table. This audit "
1609
+ "reports drift only; it does not force one giant canary or execute checks."
1610
+ ),
1611
+ }
1612
+
1613
+
1614
+ def _selector_blob(changed_files: list[str], surfaces: list[str]) -> str:
1615
+ return "\n".join([*changed_files, *surfaces]).lower()
1616
+
1617
+
1618
+ def _selection_reasons(profile: dict[str, Any], selector_blob: str) -> list[str]:
1619
+ family = str(profile.get("family") or "")
1620
+ family_lc = family.lower()
1621
+ reasons: list[str] = []
1622
+ if family_lc and family_lc in selector_blob:
1623
+ reasons.append(f"selector names catalog family `{family}`")
1624
+ for hint in FAMILY_SELECTOR_HINTS.get(family, ()):
1625
+ if hint.lower() in selector_blob:
1626
+ reasons.append(f"selector matches `{hint}`")
1627
+ trigger_surfaces = str(profile.get("trigger_surfaces") or "").lower()
1628
+ for token in re.findall(r"[a-z][a-z0-9_-]{2,}", selector_blob):
1629
+ if token in trigger_surfaces and f"trigger surface mentions `{token}`" not in reasons:
1630
+ reasons.append(f"trigger surface mentions `{token}`")
1631
+ return reasons
1632
+
1633
+
1634
+ def _domain_selection_reasons(profile: dict[str, Any], selector_blob: str) -> list[str]:
1635
+ reasons: list[str] = []
1636
+ profile_id = str(profile.get("id") or "")
1637
+ title = str(profile.get("title") or "")
1638
+ if profile_id and profile_id in selector_blob:
1639
+ reasons.append(f"selector names profile `{profile_id}`")
1640
+ if title and title.lower() in selector_blob:
1641
+ reasons.append(f"selector names profile `{title}`")
1642
+ for hint in profile.get("trigger_hints", []):
1643
+ hint_text = str(hint or "").lower()
1644
+ if hint_text and hint_text in selector_blob:
1645
+ reasons.append(f"selector matches `{hint}`")
1646
+ for family in profile.get("catalog_families", []):
1647
+ family_text = str(family or "").lower()
1648
+ if family_text and family_text in selector_blob:
1649
+ reasons.append(f"selector matches family `{family}`")
1650
+ return reasons
1651
+
1652
+
1653
+ def _domain_profile_with_checks(
1654
+ profile: dict[str, Any],
1655
+ *,
1656
+ include_deep_checks: bool,
1657
+ max_checks: int,
1658
+ ) -> dict[str, Any]:
1659
+ checks = [
1660
+ dict(check)
1661
+ for check in profile.get("checks", [])
1662
+ if include_deep_checks or check.get("tier") != "deep"
1663
+ ]
1664
+ copied = dict(profile)
1665
+ copied["checks"] = checks[: max(1, max_checks)]
1666
+ copied["deep_checks_available"] = any(
1667
+ isinstance(check, dict) and check.get("tier") == "deep"
1668
+ for check in profile.get("checks", [])
1669
+ )
1670
+ copied["deep_checks_included"] = bool(include_deep_checks)
1671
+ return copied
1672
+
1673
+
1674
+ def flatten_catalog_canary_checks(plan: dict[str, Any]) -> list[dict[str, Any]]:
1675
+ """Return selected canary checks in execution order."""
1676
+
1677
+ checks: list[dict[str, Any]] = []
1678
+ seen: set[str] = set()
1679
+ for profile in plan.get("domain_profiles", []):
1680
+ if not isinstance(profile, dict):
1681
+ continue
1682
+ for check in profile.get("checks", []):
1683
+ if not isinstance(check, dict):
1684
+ continue
1685
+ command = str(check.get("command") or "")
1686
+ if not command or command in seen:
1687
+ continue
1688
+ seen.add(command)
1689
+ checks.append(
1690
+ {
1691
+ "source": "domain_profile",
1692
+ "profile_id": profile.get("id"),
1693
+ "profile_title": profile.get("title"),
1694
+ "tier": check.get("tier") or "default",
1695
+ **check,
1696
+ }
1697
+ )
1698
+ for profile in plan.get("profiles", []):
1699
+ if not isinstance(profile, dict):
1700
+ continue
1701
+ for check in profile.get("candidate_checks", []):
1702
+ if not isinstance(check, dict):
1703
+ continue
1704
+ command = str(check.get("command") or "")
1705
+ if not command or command in seen:
1706
+ continue
1707
+ seen.add(command)
1708
+ checks.append(
1709
+ {
1710
+ "source": "catalog_family",
1711
+ "profile_id": profile.get("id"),
1712
+ "profile_title": profile.get("family"),
1713
+ "tier": check.get("tier") or "default",
1714
+ **check,
1715
+ }
1716
+ )
1717
+ return checks
1718
+
1719
+
1720
+ def build_catalog_canary_plan(
1721
+ *,
1722
+ catalog_path: Path | None = None,
1723
+ changed_files: list[str] | None = None,
1724
+ surfaces: list[str] | None = None,
1725
+ families: list[str] | None = None,
1726
+ profiles: list[str] | None = None,
1727
+ include_deep_checks: bool = False,
1728
+ max_checks_per_family: int = 3,
1729
+ max_checks_per_profile: int = 3,
1730
+ ) -> dict[str, Any]:
1731
+ packet = build_catalog_canary_profiles(catalog_path)
1732
+ changed_files = changed_files or []
1733
+ surfaces = surfaces or []
1734
+ requested_families = {_slug(family) for family in (families or []) if family.strip()}
1735
+ requested_profiles = {_slug(profile) for profile in (profiles or []) if profile.strip()}
1736
+ selector_blob = _selector_blob(changed_files, surfaces)
1737
+ max_checks = max(1, max_checks_per_family)
1738
+ max_profile_checks = max(1, max_checks_per_profile)
1739
+ catalog_profile_ids = {
1740
+ _catalog_profile_id(profile)
1741
+ for profile in packet["profiles"]
1742
+ if isinstance(profile, dict)
1743
+ }
1744
+ requested_catalog_profiles = requested_profiles & catalog_profile_ids
1745
+ requested_domain_profiles = requested_profiles - requested_catalog_profiles
1746
+
1747
+ selected_profiles: list[dict[str, Any]] = []
1748
+ for profile in packet["profiles"]:
1749
+ profile_id = _catalog_profile_id(profile)
1750
+ if requested_domain_profiles and not requested_catalog_profiles and not requested_families and not selector_blob:
1751
+ continue
1752
+ reasons = _selection_reasons(profile, selector_blob)
1753
+ if requested_catalog_profiles and profile_id not in requested_catalog_profiles:
1754
+ continue
1755
+ if requested_families and _slug(str(profile.get("family") or "")) not in requested_families:
1756
+ continue
1757
+ if not requested_catalog_profiles and not requested_families and selector_blob and not reasons:
1758
+ continue
1759
+ profile_copy = dict(profile)
1760
+ profile_copy["candidate_checks"] = list(profile_copy.get("candidate_checks", []))[:max_checks]
1761
+ if requested_catalog_profiles and profile_id in requested_catalog_profiles:
1762
+ profile_copy["selection_reasons"] = reasons or [
1763
+ "selected because this catalog profile was explicitly requested",
1764
+ ]
1765
+ else:
1766
+ profile_copy["selection_reasons"] = reasons or [
1767
+ "selected because no narrower selector was provided",
1768
+ ]
1769
+ selected_profiles.append(profile_copy)
1770
+
1771
+ selected_domain_profiles: list[dict[str, Any]] = []
1772
+ for profile in packet["domain_profiles"]:
1773
+ reasons = _domain_selection_reasons(profile, selector_blob)
1774
+ if requested_domain_profiles and _slug(str(profile.get("id") or "")) not in requested_domain_profiles:
1775
+ continue
1776
+ if requested_catalog_profiles and not requested_domain_profiles:
1777
+ continue
1778
+ if not requested_domain_profiles and selector_blob and not reasons:
1779
+ continue
1780
+ if not requested_domain_profiles and not selector_blob:
1781
+ continue
1782
+ profile_copy = _domain_profile_with_checks(
1783
+ profile,
1784
+ include_deep_checks=include_deep_checks,
1785
+ max_checks=max_profile_checks,
1786
+ )
1787
+ profile_copy["selection_reasons"] = reasons or [
1788
+ "selected because this profile was explicitly requested",
1789
+ ]
1790
+ selected_domain_profiles.append(profile_copy)
1791
+
1792
+ payload = {
1793
+ "ok": True,
1794
+ "schema_version": CANARY_PLAN_SCHEMA_VERSION,
1795
+ "source": packet["source"],
1796
+ "dry_run": True,
1797
+ "executes_checks": False,
1798
+ "selection_inputs": {
1799
+ "changed_files": changed_files,
1800
+ "surfaces": surfaces,
1801
+ "families": families or [],
1802
+ "profiles": profiles or [],
1803
+ "include_deep_checks": include_deep_checks,
1804
+ "max_checks_per_family": max_checks,
1805
+ "max_checks_per_profile": max_profile_checks,
1806
+ },
1807
+ "profile_count": len(selected_profiles),
1808
+ "domain_profile_count": len(selected_domain_profiles),
1809
+ "profiles": selected_profiles,
1810
+ "domain_profiles": selected_domain_profiles,
1811
+ "note": (
1812
+ "This planner only selects and explains candidate canary checks. "
1813
+ "It does not execute smoke tests or create new runtime contracts. "
1814
+ "Plan from existing public runtime/status contracts first; when a "
1815
+ "new runtime contract seems necessary, stop at an owner-review "
1816
+ "necessity/risk packet before implementation."
1817
+ ),
1818
+ }
1819
+ suggested_checks = flatten_catalog_canary_checks(payload)
1820
+ payload["suggested_check_count"] = len(suggested_checks)
1821
+ payload["suggested_checks"] = suggested_checks
1822
+ payload["commands"] = [str(check.get("command") or "") for check in suggested_checks]
1823
+ return payload
1824
+
1825
+
1826
+ def render_catalog_canary_profiles_markdown(payload: dict[str, Any]) -> str:
1827
+ lines = [
1828
+ "# Catalog Canary Profiles",
1829
+ "",
1830
+ f"- source: `{payload.get('source')}`",
1831
+ f"- archetypes: `{payload.get('archetype_count')}`",
1832
+ f"- profiles: `{payload.get('profile_count')}`",
1833
+ "- dry_run: `true`",
1834
+ "- executes_checks: `false`",
1835
+ "",
1836
+ ]
1837
+ for profile in payload.get("profiles", []):
1838
+ if not isinstance(profile, dict):
1839
+ continue
1840
+ lines.extend(
1841
+ [
1842
+ f"## {profile.get('family')}",
1843
+ f"- patterns: `{', '.join(profile.get('pattern_ids') or [])}`",
1844
+ "- archetypes: "
1845
+ + ", ".join(
1846
+ f"`{item.get('name')}`"
1847
+ for item in profile.get("default_archetypes", [])
1848
+ if isinstance(item, dict)
1849
+ ),
1850
+ f"- trigger surfaces: {profile.get('trigger_surfaces')}",
1851
+ f"- minimum fixture: {profile.get('minimum_useful_fixture')}",
1852
+ f"- failure meaning: {profile.get('failure_meaning')}",
1853
+ "",
1854
+ ]
1855
+ )
1856
+ if payload.get("domain_profiles"):
1857
+ lines.extend(["## Current Repo Profiles", ""])
1858
+ for profile in payload.get("domain_profiles", []):
1859
+ if not isinstance(profile, dict):
1860
+ continue
1861
+ default_count = sum(
1862
+ 1 for check in profile.get("checks", []) if isinstance(check, dict) and check.get("tier") != "deep"
1863
+ )
1864
+ deep_count = sum(
1865
+ 1 for check in profile.get("checks", []) if isinstance(check, dict) and check.get("tier") == "deep"
1866
+ )
1867
+ lines.extend(
1868
+ [
1869
+ f"### {profile.get('title')}",
1870
+ f"- id: `{profile.get('id')}`",
1871
+ f"- catalog families: `{', '.join(profile.get('catalog_families') or [])}`",
1872
+ f"- purpose: {profile.get('purpose')}",
1873
+ f"- default checks: `{default_count}`",
1874
+ f"- deep checks: `{deep_count}`",
1875
+ "",
1876
+ ]
1877
+ )
1878
+ return "\n".join(lines).rstrip() + "\n"
1879
+
1880
+
1881
+ def render_catalog_canary_plan_markdown(payload: dict[str, Any]) -> str:
1882
+ inputs = payload.get("selection_inputs") if isinstance(payload.get("selection_inputs"), dict) else {}
1883
+ lines = [
1884
+ "# Catalog Canary Plan",
1885
+ "",
1886
+ f"- source: `{payload.get('source')}`",
1887
+ "- dry_run: `true`",
1888
+ "- executes_checks: `false`",
1889
+ f"- selected_profiles: `{payload.get('profile_count')}`",
1890
+ f"- selected_domain_profiles: `{payload.get('domain_profile_count')}`",
1891
+ f"- changed_files: `{', '.join(inputs.get('changed_files') or [])}`",
1892
+ f"- surfaces: `{', '.join(inputs.get('surfaces') or [])}`",
1893
+ f"- families: `{', '.join(inputs.get('families') or [])}`",
1894
+ f"- profiles: `{', '.join(inputs.get('profiles') or [])}`",
1895
+ f"- include_deep_checks: `{str(inputs.get('include_deep_checks')).lower()}`",
1896
+ "",
1897
+ str(payload.get("note") or ""),
1898
+ "",
1899
+ ]
1900
+ for profile in payload.get("profiles", []):
1901
+ if not isinstance(profile, dict):
1902
+ continue
1903
+ lines.extend(
1904
+ [
1905
+ f"## {profile.get('family')}",
1906
+ f"- patterns: `{', '.join(profile.get('pattern_ids') or [])}`",
1907
+ "- selected because: "
1908
+ + "; ".join(str(reason) for reason in profile.get("selection_reasons", [])),
1909
+ "- archetypes: "
1910
+ + ", ".join(
1911
+ f"`{item.get('name')}`"
1912
+ for item in profile.get("default_archetypes", [])
1913
+ if isinstance(item, dict)
1914
+ ),
1915
+ f"- minimum fixture: {profile.get('minimum_useful_fixture')}",
1916
+ f"- failure meaning: {profile.get('failure_meaning')}",
1917
+ "- suggested checks:",
1918
+ ]
1919
+ )
1920
+ for check in profile.get("candidate_checks", []):
1921
+ if isinstance(check, dict):
1922
+ lines.append(f" - `{check.get('command')}` - {check.get('reason')}")
1923
+ lines.append("")
1924
+ for profile in payload.get("domain_profiles", []):
1925
+ if not isinstance(profile, dict):
1926
+ continue
1927
+ lines.extend(
1928
+ [
1929
+ f"## {profile.get('title')}",
1930
+ f"- id: `{profile.get('id')}`",
1931
+ f"- catalog families: `{', '.join(profile.get('catalog_families') or [])}`",
1932
+ "- selected because: "
1933
+ + "; ".join(str(reason) for reason in profile.get("selection_reasons", [])),
1934
+ f"- purpose: {profile.get('purpose')}",
1935
+ f"- deep checks available: `{str(profile.get('deep_checks_available')).lower()}`",
1936
+ f"- deep checks included: `{str(profile.get('deep_checks_included')).lower()}`",
1937
+ "- suggested checks:",
1938
+ ]
1939
+ )
1940
+ for check in profile.get("checks", []):
1941
+ if isinstance(check, dict):
1942
+ lines.append(
1943
+ f" - `{check.get('command')}` [{check.get('tier')}] - {check.get('reason')}"
1944
+ )
1945
+ lines.append("")
1946
+ return "\n".join(lines).rstrip() + "\n"
1947
+
1948
+
1949
+ def render_catalog_canary_coverage_audit_markdown(payload: dict[str, Any]) -> str:
1950
+ lines = [
1951
+ "# Catalog Canary Coverage Audit",
1952
+ "",
1953
+ f"- source: `{payload.get('source')}`",
1954
+ "- dry_run: `true`",
1955
+ "- executes_checks: `false`",
1956
+ f"- priorities: `{', '.join(payload.get('priorities') or [])}`",
1957
+ f"- required_patterns: `{payload.get('required_pattern_count')}`",
1958
+ f"- covered: `{payload.get('covered_count')}`",
1959
+ f"- excepted: `{payload.get('excepted_count')}`",
1960
+ f"- missing: `{payload.get('missing_count')}`",
1961
+ f"- invalid_exceptions: `{payload.get('invalid_exception_count')}`",
1962
+ f"- drift: `{payload.get('drift_count')}`",
1963
+ "",
1964
+ str(payload.get("note") or ""),
1965
+ "",
1966
+ ]
1967
+ if payload.get("missing_patterns"):
1968
+ lines.extend(["## Missing Coverage", ""])
1969
+ for row in payload.get("missing_patterns", []):
1970
+ if isinstance(row, dict):
1971
+ lines.append(
1972
+ f"- `{row.get('pattern_id')}` {row.get('name')} ({row.get('importance')})"
1973
+ )
1974
+ lines.append("")
1975
+ if payload.get("invalid_exceptions"):
1976
+ lines.extend(["## Invalid Exceptions", ""])
1977
+ for row in payload.get("invalid_exceptions", []):
1978
+ if isinstance(row, dict):
1979
+ lines.append(
1980
+ f"- `{row.get('pattern_id')}` {row.get('status')}: "
1981
+ f"rationale={row.get('rationale')!r}; owner={row.get('owner')!r}"
1982
+ )
1983
+ lines.append("")
1984
+ return "\n".join(lines).rstrip() + "\n"