loopx 0.4.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- loopx/__init__.py +5 -0
- loopx/agent_onboarding.py +654 -0
- loopx/agent_registry.py +112 -0
- loopx/ark_managed_agent_host.py +59 -0
- loopx/authority.py +805 -0
- loopx/benchmark.py +2875 -0
- loopx/benchmark_adapters/__init__.py +1 -0
- loopx/benchmark_adapters/agentissue.py +2644 -0
- loopx/benchmark_adapters/agents_last_exam.py +3998 -0
- loopx/benchmark_adapters/edgebench.py +322 -0
- loopx/benchmark_adapters/skillsbench.py +5978 -0
- loopx/benchmark_adapters/skillsbench_acp_failure_policy.py +143 -0
- loopx/benchmark_adapters/skillsbench_acp_process.py +31 -0
- loopx/benchmark_adapters/skillsbench_acp_relay.py +4832 -0
- loopx/benchmark_adapters/skillsbench_batch.py +124 -0
- loopx/benchmark_adapters/skillsbench_bridge_guard.py +209 -0
- loopx/benchmark_adapters/skillsbench_bridge_summary.py +203 -0
- loopx/benchmark_adapters/skillsbench_codex_goal_recovery.py +271 -0
- loopx/benchmark_adapters/skillsbench_codex_goal_trace.py +81 -0
- loopx/benchmark_adapters/skillsbench_codex_runtime.py +339 -0
- loopx/benchmark_adapters/skillsbench_dockerfile_runtime.py +467 -0
- loopx/benchmark_adapters/skillsbench_failure_signals.py +652 -0
- loopx/benchmark_adapters/skillsbench_proxy_runtime.py +327 -0
- loopx/benchmark_adapters/skillsbench_remote_bridge.py +402 -0
- loopx/benchmark_adapters/skillsbench_result_discovery.py +143 -0
- loopx/benchmark_adapters/skillsbench_runner_profile.py +436 -0
- loopx/benchmark_adapters/skillsbench_runner_source.py +99 -0
- loopx/benchmark_adapters/skillsbench_setup_preflight.py +771 -0
- loopx/benchmark_adapters/skillsbench_signals.py +15 -0
- loopx/benchmark_adapters/skillsbench_task_source.py +141 -0
- loopx/benchmark_adapters/skillsbench_turn_route.py +723 -0
- loopx/benchmark_adapters/skillsbench_turn_runtime.py +1069 -0
- loopx/benchmark_adapters/skillsbench_typed_repair.py +689 -0
- loopx/benchmark_adapters/skillsbench_uv_cache.py +111 -0
- loopx/benchmark_adapters/skillsbench_verifier_bootstrap.py +227 -0
- loopx/benchmark_adapters/skillsbench_verifier_cache.py +138 -0
- loopx/benchmark_adapters/terminal_bench.py +10078 -0
- loopx/benchmark_case_analysis.py +1276 -0
- loopx/benchmark_case_state.py +1079 -0
- loopx/benchmark_core/__init__.py +239 -0
- loopx/benchmark_core/adapter.py +84 -0
- loopx/benchmark_core/artifacts.py +517 -0
- loopx/benchmark_core/attempts.py +199 -0
- loopx/benchmark_core/container_exec.py +216 -0
- loopx/benchmark_core/io.py +68 -0
- loopx/benchmark_core/lifecycle.py +211 -0
- loopx/benchmark_core/loop_protocol.py +689 -0
- loopx/benchmark_core/observable_handles.py +348 -0
- loopx/benchmark_core/parity.py +256 -0
- loopx/benchmark_core/remote_closeout.py +482 -0
- loopx/benchmark_core/rounds.py +215 -0
- loopx/benchmark_core/route_profile.py +509 -0
- loopx/benchmark_core/run_permissions.py +206 -0
- loopx/benchmark_core/split_control.py +925 -0
- loopx/benchmark_core/turn_fidelity.py +326 -0
- loopx/benchmark_ledger.py +3793 -0
- loopx/benchmark_ledger_countability.py +372 -0
- loopx/benchmark_ledger_current.py +724 -0
- loopx/benchmark_trajectory.py +405 -0
- loopx/benchmarks/__init__.py +1 -0
- loopx/benchmarks/qualification/__init__.py +1 -0
- loopx/benchmarks/qualification/release_outcome_baseline.py +360 -0
- loopx/benchmarks/read_models/__init__.py +1 -0
- loopx/benchmarks/read_models/benchmark_attempt_accounting.py +53 -0
- loopx/benchmarks/read_models/benchmark_comparison.py +414 -0
- loopx/benchmarks/read_models/benchmark_event_timeline.py +113 -0
- loopx/benchmarks/read_models/benchmark_experiment_report.py +475 -0
- loopx/benchmarks/read_models/benchmark_learning_ledger.py +137 -0
- loopx/benchmarks/read_models/benchmark_lifecycle_contracts.py +228 -0
- loopx/benchmarks/read_models/benchmark_projection.py +723 -0
- loopx/benchmarks/read_models/benchmark_result.py +146 -0
- loopx/benchmarks/read_models/benchmark_run_execution_contract.py +116 -0
- loopx/benchmarks/read_models/benchmark_run_failure.py +157 -0
- loopx/benchmarks/read_models/benchmark_run_metrics.py +213 -0
- loopx/benchmarks/read_models/benchmark_run_post_execution.py +635 -0
- loopx/benchmarks/read_models/benchmark_run_pre_execution.py +541 -0
- loopx/benchmarks/read_models/benchmark_status_compaction.py +1255 -0
- loopx/benchmarks/read_models/benchmark_status_runner.py +780 -0
- loopx/benchmarks/read_models/goal_start_control_score.py +857 -0
- loopx/benchmarks/read_models/skillsbench_post_run_debug.py +746 -0
- loopx/benchmarks/read_models/skillsbench_verifier_attribution.py +269 -0
- loopx/bootstrap.py +1116 -0
- loopx/bootstrap_command_pack.py +2167 -0
- loopx/boundary_authority.py +199 -0
- loopx/canary/__init__.py +1 -0
- loopx/canary/maintainability_ratchet.py +800 -0
- loopx/canary/planner.py +1984 -0
- loopx/canary/premerge.py +1130 -0
- loopx/canary/qualification_profiles.py +309 -0
- loopx/canary/quality_surface_catalog.py +838 -0
- loopx/canary/release_profiles.py +51 -0
- loopx/canary/runner.py +1107 -0
- loopx/canary/smoke_health.py +581 -0
- loopx/canary/smoke_profiles.py +212 -0
- loopx/capabilities/__init__.py +0 -0
- loopx/capabilities/agent_turn_recall/__init__.py +17 -0
- loopx/capabilities/agent_turn_recall/cli.py +369 -0
- loopx/capabilities/agent_turn_recall/core.py +296 -0
- loopx/capabilities/auto_research/__init__.py +16 -0
- loopx/capabilities/auto_research/bootstrap_contract.py +157 -0
- loopx/capabilities/auto_research/cli.py +1468 -0
- loopx/capabilities/auto_research/core.py +11 -0
- loopx/capabilities/auto_research/defaults.py +79 -0
- loopx/capabilities/auto_research/demo_e2e.py +1848 -0
- loopx/capabilities/auto_research/demo_supervisor.py +186 -0
- loopx/capabilities/auto_research/evidence_packet.py +767 -0
- loopx/capabilities/auto_research/human_view.py +794 -0
- loopx/capabilities/auto_research/kernel.py +191 -0
- loopx/capabilities/auto_research/knn_demo_workspace.py +322 -0
- loopx/capabilities/auto_research/live_evidence.py +248 -0
- loopx/capabilities/auto_research/preset.py +176 -0
- loopx/capabilities/auto_research/research_state.py +1085 -0
- loopx/capabilities/auto_research/role_profiles.py +394 -0
- loopx/capabilities/auto_research/rollout_append.py +97 -0
- loopx/capabilities/auto_research/terminal_result_contract.py +422 -0
- loopx/capabilities/auto_research/terminal_result_projection.py +171 -0
- loopx/capabilities/auto_research/terminal_result_query.py +233 -0
- loopx/capabilities/auto_research/terminal_results.py +349 -0
- loopx/capabilities/auto_research/user_contract.py +190 -0
- loopx/capabilities/auto_research/worker_loop.py +163 -0
- loopx/capabilities/auto_research/worker_runtime.py +777 -0
- loopx/capabilities/auto_research/worker_skill/SKILL.md +343 -0
- loopx/capabilities/benchmark_toolkit/__init__.py +19 -0
- loopx/capabilities/benchmark_toolkit/integrity.py +387 -0
- loopx/capabilities/catalog.py +1875 -0
- loopx/capabilities/change_quality/__init__.py +19 -0
- loopx/capabilities/change_quality/cli.py +171 -0
- loopx/capabilities/change_quality/context.py +156 -0
- loopx/capabilities/change_quality/oracles.py +269 -0
- loopx/capabilities/change_quality/policy.py +34 -0
- loopx/capabilities/change_quality/receipt.py +482 -0
- loopx/capabilities/change_quality/result.py +493 -0
- loopx/capabilities/change_quality/scope.py +171 -0
- loopx/capabilities/change_quality/shadow.py +680 -0
- loopx/capabilities/content_ops/__init__.py +0 -0
- loopx/capabilities/content_ops/cli.py +649 -0
- loopx/capabilities/content_ops/connector_packets.py +164 -0
- loopx/capabilities/content_ops/item_lifecycle.py +1000 -0
- loopx/capabilities/content_ops/layout.py +451 -0
- loopx/capabilities/content_ops/markdown.py +456 -0
- loopx/capabilities/content_ops/schemas.py +51 -0
- loopx/capabilities/content_ops/social_browser_x.py +107 -0
- loopx/capabilities/content_ops/surface.py +1956 -0
- loopx/capabilities/content_ops/templates/layout-catalog-v0.json +72 -0
- loopx/capabilities/context_providers/__init__.py +36 -0
- loopx/capabilities/context_providers/base.py +189 -0
- loopx/capabilities/context_providers/factory.py +32 -0
- loopx/capabilities/context_providers/openviking.py +702 -0
- loopx/capabilities/context_providers/service_ownership.py +185 -0
- loopx/capabilities/decision_context/__init__.py +129 -0
- loopx/capabilities/decision_context/architecture.py +83 -0
- loopx/capabilities/decision_context/assembler.py +849 -0
- loopx/capabilities/decision_context/catalog_entry.py +195 -0
- loopx/capabilities/decision_context/cli.py +310 -0
- loopx/capabilities/decision_context/cursor_commit.py +535 -0
- loopx/capabilities/decision_context/outcome_feedback.py +352 -0
- loopx/capabilities/decision_context/packets.py +654 -0
- loopx/capabilities/decision_context/private_state.py +189 -0
- loopx/capabilities/decision_context/profile.py +453 -0
- loopx/capabilities/decision_context/providers.py +228 -0
- loopx/capabilities/decision_context/review_settlement.py +136 -0
- loopx/capabilities/decision_context/runtime.py +273 -0
- loopx/capabilities/decision_context/sources.py +415 -0
- loopx/capabilities/explore/__init__.py +1 -0
- loopx/capabilities/explore/activation.py +198 -0
- loopx/capabilities/explore/adaptive_replay_planner.py +221 -0
- loopx/capabilities/explore/child_replay_runtime.py +463 -0
- loopx/capabilities/explore/composition_frontier.py +291 -0
- loopx/capabilities/explore/counterfactual_runtime.py +578 -0
- loopx/capabilities/explore/episode_runtime.py +647 -0
- loopx/capabilities/explore/harness_checkpoint.py +171 -0
- loopx/capabilities/explore/harness_gate.py +115 -0
- loopx/capabilities/explore/harness_runtime.py +1124 -0
- loopx/capabilities/explore/replay_metrics.py +206 -0
- loopx/capabilities/explore/replay_runtime.py +1271 -0
- loopx/capabilities/explore/resource_portfolio.py +173 -0
- loopx/capabilities/explore/result_log.py +974 -0
- loopx/capabilities/explore/router_state.py +432 -0
- loopx/capabilities/explore/source_history_reconcile.py +255 -0
- loopx/capabilities/explore/speculative_scheduler.py +498 -0
- loopx/capabilities/explore/todo_branch_plan.py +650 -0
- loopx/capabilities/explore/todo_evidence.py +141 -0
- loopx/capabilities/explore/trace_runtime.py +284 -0
- loopx/capabilities/explore/worker_branch_plan.py +1257 -0
- loopx/capabilities/integration_branch/__init__.py +13 -0
- loopx/capabilities/integration_branch/cli.py +148 -0
- loopx/capabilities/integration_branch/core.py +916 -0
- loopx/capabilities/issue_fix/__init__.py +19 -0
- loopx/capabilities/issue_fix/acceptance_loop.py +1050 -0
- loopx/capabilities/issue_fix/candidate_evidence.py +503 -0
- loopx/capabilities/issue_fix/candidate_preflight.py +676 -0
- loopx/capabilities/issue_fix/cli.py +1822 -0
- loopx/capabilities/issue_fix/cli_input.py +87 -0
- loopx/capabilities/issue_fix/content_ops_cli.py +148 -0
- loopx/capabilities/issue_fix/discovered_issue_promotion.py +947 -0
- loopx/capabilities/issue_fix/explore_projection.py +710 -0
- loopx/capabilities/issue_fix/feasibility.py +542 -0
- loopx/capabilities/issue_fix/github_public.py +661 -0
- loopx/capabilities/issue_fix/intake_surface.py +832 -0
- loopx/capabilities/issue_fix/metadata_preview.py +218 -0
- loopx/capabilities/issue_fix/metrics_projection.py +1340 -0
- loopx/capabilities/issue_fix/metrics_supplement.py +634 -0
- loopx/capabilities/issue_fix/metrics_supplement_cli.py +127 -0
- loopx/capabilities/issue_fix/outcome_projection.py +1235 -0
- loopx/capabilities/issue_fix/periodic_report.py +189 -0
- loopx/capabilities/issue_fix/pr_description.py +418 -0
- loopx/capabilities/issue_fix/pr_gate_reconcile.py +496 -0
- loopx/capabilities/issue_fix/pr_gate_reconcile_cli.py +464 -0
- loopx/capabilities/issue_fix/pr_lifecycle.py +1327 -0
- loopx/capabilities/issue_fix/pr_lifecycle_rollout.py +85 -0
- loopx/capabilities/issue_fix/pr_monitor_materialization.py +257 -0
- loopx/capabilities/issue_fix/pr_review_ack.py +439 -0
- loopx/capabilities/issue_fix/provider_hooks.py +24 -0
- loopx/capabilities/issue_fix/repository_commit_evidence.py +186 -0
- loopx/capabilities/issue_fix/repository_context.py +457 -0
- loopx/capabilities/issue_fix/repository_memory.py +459 -0
- loopx/capabilities/issue_fix/repository_memory_provider.py +1454 -0
- loopx/capabilities/issue_fix/repository_snapshot.py +454 -0
- loopx/capabilities/issue_fix/reviewer_cli.py +917 -0
- loopx/capabilities/issue_fix/reviewer_notification.py +882 -0
- loopx/capabilities/issue_fix/reviewer_notification_drain.py +942 -0
- loopx/capabilities/issue_fix/reviewer_recommendation.py +1057 -0
- loopx/capabilities/issue_fix/reviewer_request.py +1282 -0
- loopx/capabilities/issue_fix/reward_memory.py +879 -0
- loopx/capabilities/issue_fix/workflow_plan.py +1286 -0
- loopx/capabilities/material_lifecycle/__init__.py +161 -0
- loopx/capabilities/material_lifecycle/_validation.py +183 -0
- loopx/capabilities/material_lifecycle/apply.py +672 -0
- loopx/capabilities/material_lifecycle/architecture.py +122 -0
- loopx/capabilities/material_lifecycle/cli.py +161 -0
- loopx/capabilities/material_lifecycle/decision_planning.py +470 -0
- loopx/capabilities/material_lifecycle/explore_execution.py +306 -0
- loopx/capabilities/material_lifecycle/intake.py +869 -0
- loopx/capabilities/material_lifecycle/inventory.py +147 -0
- loopx/capabilities/material_lifecycle/lifecycle.py +98 -0
- loopx/capabilities/material_lifecycle/preparation.py +147 -0
- loopx/capabilities/material_lifecycle/project_skill.py +83 -0
- loopx/capabilities/material_lifecycle/ranking.py +267 -0
- loopx/capabilities/material_lifecycle/readable_projection.py +500 -0
- loopx/capabilities/material_lifecycle/rebuild.py +480 -0
- loopx/capabilities/material_lifecycle/settlement.py +238 -0
- loopx/capabilities/periodic_report/__init__.py +71 -0
- loopx/capabilities/periodic_report/adapters.py +939 -0
- loopx/capabilities/periodic_report/archive.py +422 -0
- loopx/capabilities/periodic_report/bindings.py +705 -0
- loopx/capabilities/periodic_report/cli.py +277 -0
- loopx/capabilities/periodic_report/core.py +691 -0
- loopx/capabilities/periodic_report/extension_envelope.py +66 -0
- loopx/capabilities/periodic_report/presets.py +103 -0
- loopx/capabilities/periodic_report/profile.py +235 -0
- loopx/capabilities/periodic_report/project_progress.py +179 -0
- loopx/capabilities/periodic_report/triggers.py +452 -0
- loopx/capabilities/pr_review_queue/__init__.py +17 -0
- loopx/capabilities/pr_review_queue/core.py +506 -0
- loopx/capabilities/pr_review_queue/review_contract.py +506 -0
- loopx/capabilities/registry.py +192 -0
- loopx/capabilities/reward_memory/__init__.py +75 -0
- loopx/capabilities/reward_memory/application.py +819 -0
- loopx/capabilities/reward_memory/architecture.py +572 -0
- loopx/capabilities/reward_memory/candidate_review.py +511 -0
- loopx/capabilities/reward_memory/cli.py +469 -0
- loopx/capabilities/reward_memory/dogfood.py +574 -0
- loopx/capabilities/reward_memory/evaluation.py +296 -0
- loopx/capabilities/reward_memory/evaluation_fixtures.py +362 -0
- loopx/capabilities/reward_memory/experiment.py +567 -0
- loopx/capabilities/reward_memory/health.py +222 -0
- loopx/capabilities/reward_memory/ingestion.py +519 -0
- loopx/capabilities/reward_memory/registry.py +600 -0
- loopx/capabilities/reward_memory/runtime_hooks.py +312 -0
- loopx/capabilities/reward_memory/scoped_feedback.py +173 -0
- loopx/capabilities/semantic_preference/__init__.py +12 -0
- loopx/capabilities/semantic_preference/cli.py +189 -0
- loopx/capabilities/semantic_preference/contract.py +592 -0
- loopx/capabilities/semantic_preference/reward_memory.py +62 -0
- loopx/capabilities/value_connectors/__init__.py +1 -0
- loopx/capabilities/value_connectors/cli.py +401 -0
- loopx/capabilities/value_connectors/finance_extension_migration.py +108 -0
- loopx/capabilities/value_connectors/install_check.py +147 -0
- loopx/capabilities/value_connectors/planner.py +733 -0
- loopx/capabilities/value_connectors/source_map.py +446 -0
- loopx/claude_goal_baseline.py +138 -0
- loopx/claude_goal_mode/__init__.py +23 -0
- loopx/claude_goal_mode/hooks/goal_policy.py +212 -0
- loopx/claude_goal_mode/hooks/goal_state.py +139 -0
- loopx/claude_goal_mode/mcp/loopx_mcp.py +167 -0
- loopx/claude_goal_mode/scripts/connect.py +103 -0
- loopx/claude_goal_mode/scripts/goalmode_cmd.py +241 -0
- loopx/claude_goal_mode/scripts/install.py +328 -0
- loopx/claude_goal_mode/statusline/goal_status.py +97 -0
- loopx/cli.py +836 -0
- loopx/cli_commands/__init__.py +334 -0
- loopx/cli_commands/_host_thread.py +13 -0
- loopx/cli_commands/agentissue_runner_flow.py +447 -0
- loopx/cli_commands/agents_last_exam.py +160 -0
- loopx/cli_commands/agents_last_exam_baked_input.py +302 -0
- loopx/cli_commands/agents_last_exam_host_codex.py +374 -0
- loopx/cli_commands/agents_last_exam_launch_dry_run.py +372 -0
- loopx/cli_commands/agents_last_exam_local_plan.py +322 -0
- loopx/cli_commands/agents_last_exam_runner_source.py +352 -0
- loopx/cli_commands/agents_last_exam_task_material.py +335 -0
- loopx/cli_commands/agents_last_exam_validation_gate.py +236 -0
- loopx/cli_commands/benchmark_boundary.py +499 -0
- loopx/cli_commands/benchmark_dispatch.py +161 -0
- loopx/cli_commands/benchmark_release_outcome.py +123 -0
- loopx/cli_commands/benchmark_review_lifecycle.py +1275 -0
- loopx/cli_commands/benchmark_run_ledger.py +763 -0
- loopx/cli_commands/benchmark_run_ledger_case_analysis.py +249 -0
- loopx/cli_commands/benchmark_run_ledger_classification.py +45 -0
- loopx/cli_commands/benchmark_run_ledger_maintenance.py +486 -0
- loopx/cli_commands/benchmark_run_ledger_maintenance_registration.py +342 -0
- loopx/cli_commands/benchmark_run_ledger_maintenance_rendering.py +233 -0
- loopx/cli_commands/benchmark_run_ledger_parity.py +92 -0
- loopx/cli_commands/bootstrap_connect.py +238 -0
- loopx/cli_commands/canary.py +707 -0
- loopx/cli_commands/canary_release_qualification.py +79 -0
- loopx/cli_commands/capability.py +96 -0
- loopx/cli_commands/doctor.py +43 -0
- loopx/cli_commands/dreaming.py +143 -0
- loopx/cli_commands/edgebench.py +205 -0
- loopx/cli_commands/evidence_log.py +275 -0
- loopx/cli_commands/explore.py +989 -0
- loopx/cli_commands/explore_planning_commands.py +157 -0
- loopx/cli_commands/extension.py +271 -0
- loopx/cli_commands/first_run_report.py +73 -0
- loopx/cli_commands/goal_channel.py +656 -0
- loopx/cli_commands/handoff_mode.py +158 -0
- loopx/cli_commands/history.py +622 -0
- loopx/cli_commands/host_mode_plan.py +113 -0
- loopx/cli_commands/lark_inbox.py +431 -0
- loopx/cli_commands/lark_kanban.py +629 -0
- loopx/cli_commands/ml_experiment.py +321 -0
- loopx/cli_commands/multi_agent.py +211 -0
- loopx/cli_commands/opencode2_goal_worker.py +217 -0
- loopx/cli_commands/pr_review.py +167 -0
- loopx/cli_commands/presentation.py +218 -0
- loopx/cli_commands/preset.py +96 -0
- loopx/cli_commands/project.py +150 -0
- loopx/cli_commands/project_lifecycle.py +915 -0
- loopx/cli_commands/quota.py +859 -0
- loopx/cli_commands/quota_registration.py +241 -0
- loopx/cli_commands/quota_request.py +113 -0
- loopx/cli_commands/ready_score.py +110 -0
- loopx/cli_commands/registry_admin.py +975 -0
- loopx/cli_commands/registry_admin_configure.py +344 -0
- loopx/cli_commands/registry_admin_peer.py +84 -0
- loopx/cli_commands/registry_authority.py +218 -0
- loopx/cli_commands/review_batch.py +146 -0
- loopx/cli_commands/slash_commands.py +145 -0
- loopx/cli_commands/start_goal.py +251 -0
- loopx/cli_commands/starter.py +175 -0
- loopx/cli_commands/starter_bootstrap.py +179 -0
- loopx/cli_commands/starter_bootstrap_registration.py +198 -0
- loopx/cli_commands/starter_runtime_idle.py +107 -0
- loopx/cli_commands/starter_scheduler.py +207 -0
- loopx/cli_commands/starter_session_runtime.py +152 -0
- loopx/cli_commands/starter_visible_common.py +54 -0
- loopx/cli_commands/starter_visible_driver.py +161 -0
- loopx/cli_commands/starter_visible_pilot.py +278 -0
- loopx/cli_commands/status.py +867 -0
- loopx/cli_commands/status_registration.py +239 -0
- loopx/cli_commands/summary_all.py +222 -0
- loopx/cli_commands/support_control.py +809 -0
- loopx/cli_commands/support_control_registry.py +68 -0
- loopx/cli_commands/support_control_supervisor.py +289 -0
- loopx/cli_commands/task_lease.py +306 -0
- loopx/cli_commands/terminal_bench_adapter.py +717 -0
- loopx/cli_commands/terminal_bench_environment_result.py +1246 -0
- loopx/cli_commands/todo.py +940 -0
- loopx/cli_commands/todo_argument_validation.py +572 -0
- loopx/cli_commands/todo_event.py +114 -0
- loopx/cli_commands/turn.py +804 -0
- loopx/cli_commands/version.py +46 -0
- loopx/cli_commands/worker_bridge.py +659 -0
- loopx/cli_rollout.py +314 -0
- loopx/codex_cli_goal_tui.py +672 -0
- loopx/codex_cli_probe.py +1530 -0
- loopx/codex_cli_probe_markdown.py +935 -0
- loopx/codex_cli_runtime_probe.py +733 -0
- loopx/codex_cli_scheduler.py +564 -0
- loopx/codex_goal_baseline.py +620 -0
- loopx/configuration_catalog.py +617 -0
- loopx/configure_goal.py +1375 -0
- loopx/contract.py +996 -0
- loopx/control_plane/__init__.py +71 -0
- loopx/control_plane/agents/__init__.py +1 -0
- loopx/control_plane/agents/agent_lane_recommendation.py +516 -0
- loopx/control_plane/agents/agent_scope.py +1578 -0
- loopx/control_plane/agents/agent_scope_frontier.py +60 -0
- loopx/control_plane/agents/capability_gate.py +531 -0
- loopx/control_plane/agents/identity.py +140 -0
- loopx/control_plane/agents/legacy_migration.py +169 -0
- loopx/control_plane/agents/management_projection.py +658 -0
- loopx/control_plane/agents/material_frontier.py +608 -0
- loopx/control_plane/agents/material_handoff.py +156 -0
- loopx/control_plane/agents/multi_agent/__init__.py +1 -0
- loopx/control_plane/agents/multi_agent/codex_executable.py +207 -0
- loopx/control_plane/agents/multi_agent/collective_round_ledger.py +387 -0
- loopx/control_plane/agents/multi_agent/contract.py +474 -0
- loopx/control_plane/agents/multi_agent/recipe.py +110 -0
- loopx/control_plane/agents/multi_agent/role_successor.py +297 -0
- loopx/control_plane/agents/multi_agent/runtime_scripts.py +426 -0
- loopx/control_plane/agents/multi_agent/visible_launch_policy.py +149 -0
- loopx/control_plane/agents/multi_agent/visible_wake_scheduler.py +392 -0
- loopx/control_plane/agents/profile.py +216 -0
- loopx/control_plane/agents/runtime_model.py +73 -0
- loopx/control_plane/agents/subagent_activity.py +164 -0
- loopx/control_plane/agents/supervisor.py +544 -0
- loopx/control_plane/agents/supervisor_events.py +462 -0
- loopx/control_plane/agents/supervisor_inject.py +204 -0
- loopx/control_plane/agents/work_mode.py +56 -0
- loopx/control_plane/agents/workspace_guard.py +364 -0
- loopx/control_plane/effect_program.py +644 -0
- loopx/control_plane/goals/__init__.py +1 -0
- loopx/control_plane/goals/active_state_event_projection.py +103 -0
- loopx/control_plane/goals/active_state_metadata.py +47 -0
- loopx/control_plane/goals/active_state_sections.py +58 -0
- loopx/control_plane/goals/configure_goal_service.py +354 -0
- loopx/control_plane/goals/contract_health.py +132 -0
- loopx/control_plane/goals/dreaming.py +152 -0
- loopx/control_plane/goals/global_registry_health.py +199 -0
- loopx/control_plane/goals/global_registry_shadow.py +33 -0
- loopx/control_plane/goals/goal_channel.py +34 -0
- loopx/control_plane/goals/goal_channel_projection.py +560 -0
- loopx/control_plane/goals/goal_frontier/__init__.py +1917 -0
- loopx/control_plane/goals/goal_frontier/ack_policy.py +149 -0
- loopx/control_plane/goals/goal_frontier/outcome_continuity.py +437 -0
- loopx/control_plane/goals/goal_frontier/replan_rules.py +210 -0
- loopx/control_plane/goals/goal_frontier/semantic_history.py +314 -0
- loopx/control_plane/goals/goal_frontier/terminal.py +180 -0
- loopx/control_plane/goals/goal_vision.py +443 -0
- loopx/control_plane/goals/goal_vision_policy.py +36 -0
- loopx/control_plane/goals/goal_vision_state.py +62 -0
- loopx/control_plane/goals/goal_vision_wait.py +290 -0
- loopx/control_plane/goals/path_resolution.py +20 -0
- loopx/control_plane/goals/start_contract.py +206 -0
- loopx/control_plane/goals/vision_checkpoint.py +92 -0
- loopx/control_plane/handoff/__init__.py +1 -0
- loopx/control_plane/handoff/cross_runtime_impl_review.py +311 -0
- loopx/control_plane/handoff/delivery_contract.py +161 -0
- loopx/control_plane/handoff/handoff_runs.py +71 -0
- loopx/control_plane/handoff/project_handoff.py +155 -0
- loopx/control_plane/handoff/review_batch.py +463 -0
- loopx/control_plane/handoff/review_packet_context.py +216 -0
- loopx/control_plane/heartbeat/agent.py +173 -0
- loopx/control_plane/heartbeat/budget.py +66 -0
- loopx/control_plane/heartbeat/builder.py +501 -0
- loopx/control_plane/heartbeat/host.py +64 -0
- loopx/control_plane/heartbeat/rules.py +68 -0
- loopx/control_plane/heartbeat/task_body.py +759 -0
- loopx/control_plane/heartbeat/visible_goal.py +86 -0
- loopx/control_plane/projects/__init__.py +1 -0
- loopx/control_plane/projects/contract.py +25 -0
- loopx/control_plane/projects/registry.py +663 -0
- loopx/control_plane/quota/__init__.py +1 -0
- loopx/control_plane/quota/cli_projection.py +704 -0
- loopx/control_plane/quota/decision_summary.py +431 -0
- loopx/control_plane/quota/effect_program.py +152 -0
- loopx/control_plane/quota/error_codes.py +19 -0
- loopx/control_plane/quota/goal_boundary.py +464 -0
- loopx/control_plane/quota/heartbeat_receipt.py +277 -0
- loopx/control_plane/quota/heartbeat_recommendation.py +718 -0
- loopx/control_plane/quota/host_poll_receipts.py +162 -0
- loopx/control_plane/quota/live_decision.py +142 -0
- loopx/control_plane/quota/monitor_poll.py +786 -0
- loopx/control_plane/quota/policy_constants.py +40 -0
- loopx/control_plane/quota/projection_repair.py +262 -0
- loopx/control_plane/quota/recent_runs.py +210 -0
- loopx/control_plane/quota/scheduler_ack.py +490 -0
- loopx/control_plane/quota/selected_todo_projection.py +139 -0
- loopx/control_plane/quota/settlement.py +437 -0
- loopx/control_plane/quota/settlement_cli.py +246 -0
- loopx/control_plane/quota/settlement_validation.py +64 -0
- loopx/control_plane/quota/settlement_workspace_causality.py +180 -0
- loopx/control_plane/quota/should_run.py +249 -0
- loopx/control_plane/quota/should_run_packet.py +1165 -0
- loopx/control_plane/quota/should_run_prepare.py +675 -0
- loopx/control_plane/quota/slot_accounting.py +1123 -0
- loopx/control_plane/quota/spend_sources.py +11 -0
- loopx/control_plane/quota/stall_repair.py +397 -0
- loopx/control_plane/quota/states.py +29 -0
- loopx/control_plane/quota/task_orchestration.py +448 -0
- loopx/control_plane/quota/task_orchestration_admission.py +497 -0
- loopx/control_plane/quota/turn_envelope.py +889 -0
- loopx/control_plane/quota/usage_summary.py +140 -0
- loopx/control_plane/reward_memory.py +43 -0
- loopx/control_plane/runtime/__init__.py +2 -0
- loopx/control_plane/runtime/active_user_assisted_pilot.py +275 -0
- loopx/control_plane/runtime/agent_scoped_evidence_log.py +435 -0
- loopx/control_plane/runtime/decision_freshness.py +203 -0
- loopx/control_plane/runtime/event_ledger.py +197 -0
- loopx/control_plane/runtime/event_store_migration_bridge.py +196 -0
- loopx/control_plane/runtime/goal_project_route.py +70 -0
- loopx/control_plane/runtime/local_state_write_correctness.py +242 -0
- loopx/control_plane/runtime/promotion_readiness.py +152 -0
- loopx/control_plane/runtime/public_safety.py +120 -0
- loopx/control_plane/runtime/run_artifacts.py +78 -0
- loopx/control_plane/runtime/run_compaction.py +397 -0
- loopx/control_plane/runtime/run_context_retention.py +241 -0
- loopx/control_plane/runtime/run_history.py +132 -0
- loopx/control_plane/runtime/run_index_duplicates.py +205 -0
- loopx/control_plane/runtime/run_index_rebuild.py +263 -0
- loopx/control_plane/runtime/run_ingest_health.py +336 -0
- loopx/control_plane/runtime/runtime_projection_route.py +624 -0
- loopx/control_plane/runtime/runtime_projection_writer.py +98 -0
- loopx/control_plane/runtime/session_runtime.py +339 -0
- loopx/control_plane/runtime/shared_runtime_material_projection.py +332 -0
- loopx/control_plane/runtime/shared_runtime_refresh_projection.py +183 -0
- loopx/control_plane/runtime/stale_latest_run.py +90 -0
- loopx/control_plane/runtime/status_classifications.py +49 -0
- loopx/control_plane/runtime/status_projection_cache.py +235 -0
- loopx/control_plane/runtime/stride_observation.py +144 -0
- loopx/control_plane/runtime/time.py +39 -0
- loopx/control_plane/runtime/trajectory_hygiene.py +149 -0
- loopx/control_plane/runtime/validation_command.py +69 -0
- loopx/control_plane/scheduler/__init__.py +1 -0
- loopx/control_plane/scheduler/ack.py +329 -0
- loopx/control_plane/scheduler/arbitration.py +188 -0
- loopx/control_plane/scheduler/automation_liveness.py +183 -0
- loopx/control_plane/scheduler/execution_context.py +555 -0
- loopx/control_plane/scheduler/external_evidence_observation.py +428 -0
- loopx/control_plane/scheduler/monitor_display.py +143 -0
- loopx/control_plane/scheduler/monitor_poll_policy.py +161 -0
- loopx/control_plane/scheduler/monitor_poll_writeback.py +351 -0
- loopx/control_plane/scheduler/monitor_target.py +64 -0
- loopx/control_plane/scheduler/monitor_todo.py +146 -0
- loopx/control_plane/scheduler/monitor_wait.py +237 -0
- loopx/control_plane/scheduler/scheduler_hint.py +1284 -0
- loopx/control_plane/scheduler/state.py +354 -0
- loopx/control_plane/scheduler/state_transition_rules.py +179 -0
- loopx/control_plane/scheduler/time.py +10 -0
- loopx/control_plane/settlement_driver.py +293 -0
- loopx/control_plane/status/__init__.py +6 -0
- loopx/control_plane/status/active_state_projection.py +105 -0
- loopx/control_plane/status/agent_lane_projection.py +375 -0
- loopx/control_plane/status/attention_projection.py +74 -0
- loopx/control_plane/status/autonomous_replan_projection.py +103 -0
- loopx/control_plane/status/collection.py +140 -0
- loopx/control_plane/status/contract_projection.py +31 -0
- loopx/control_plane/status/dreaming_projection.py +52 -0
- loopx/control_plane/status/goal_attention_projection.py +157 -0
- loopx/control_plane/status/lifecycle_projection.py +110 -0
- loopx/control_plane/status/monitor_display_projection.py +69 -0
- loopx/control_plane/status/registry_health_projection.py +75 -0
- loopx/control_plane/status/run_projection.py +70 -0
- loopx/control_plane/status/runtime_summaries.py +161 -0
- loopx/control_plane/testing/__init__.py +1 -0
- loopx/control_plane/testing/actual_default_model_behavior_portfolio.py +1371 -0
- loopx/control_plane/testing/canary_harness.py +182 -0
- loopx/control_plane/testing/capability_monitor_repair_tool_behavior.py +674 -0
- loopx/control_plane/testing/cli_output_budget.py +807 -0
- loopx/control_plane/testing/cli_output_differential.py +250 -0
- loopx/control_plane/testing/cli_output_semantics.py +87 -0
- loopx/control_plane/testing/control_plane_composition_scenarios.py +225 -0
- loopx/control_plane/testing/decision_replay.py +268 -0
- loopx/control_plane/testing/doubao_model_behavior_actor.py +559 -0
- loopx/control_plane/testing/model_behavior_corpus.py +344 -0
- loopx/control_plane/testing/model_behavior_qualification.py +769 -0
- loopx/control_plane/testing/model_behavior_retained_cases.py +235 -0
- loopx/control_plane/testing/model_tool_behavior.py +536 -0
- loopx/control_plane/testing/onboarding_model_behavior_qualification.py +642 -0
- loopx/control_plane/testing/quota_fixtures.py +208 -0
- loopx/control_plane/testing/quota_should_run_parity.py +57 -0
- loopx/control_plane/testing/release_commit_qualification.py +671 -0
- loopx/control_plane/testing/replan_semantic_action_behavior.py +1302 -0
- loopx/control_plane/testing/scoped_gate_successor_tool_behavior.py +527 -0
- loopx/control_plane/testing/selected_todo_tool_behavior.py +1002 -0
- loopx/control_plane/testing/terminal_settlement_tool_behavior.py +656 -0
- loopx/control_plane/todos/__init__.py +1 -0
- loopx/control_plane/todos/active_state_editing.py +296 -0
- loopx/control_plane/todos/active_state_todo_parser.py +138 -0
- loopx/control_plane/todos/active_state_todos.py +175 -0
- loopx/control_plane/todos/addition.py +103 -0
- loopx/control_plane/todos/claim_visibility.py +253 -0
- loopx/control_plane/todos/completed_archive.py +139 -0
- loopx/control_plane/todos/completion_fence.py +49 -0
- loopx/control_plane/todos/completion_policy.py +153 -0
- loopx/control_plane/todos/completion_validation.py +248 -0
- loopx/control_plane/todos/completion_validation_accountability.py +27 -0
- loopx/control_plane/todos/completion_validation_projection.py +57 -0
- loopx/control_plane/todos/contract.py +1476 -0
- loopx/control_plane/todos/decision_scope.py +554 -0
- loopx/control_plane/todos/deferred_resume.py +546 -0
- loopx/control_plane/todos/durable_completion.py +201 -0
- loopx/control_plane/todos/event_writeback.py +484 -0
- loopx/control_plane/todos/frontier_deadline.py +132 -0
- loopx/control_plane/todos/handoff_gate.py +283 -0
- loopx/control_plane/todos/handoff_mode.py +444 -0
- loopx/control_plane/todos/handoff_note.py +202 -0
- loopx/control_plane/todos/line_update.py +361 -0
- loopx/control_plane/todos/list_projection.py +205 -0
- loopx/control_plane/todos/markdown.py +199 -0
- loopx/control_plane/todos/monitor_metadata.py +88 -0
- loopx/control_plane/todos/mutation_authority.py +299 -0
- loopx/control_plane/todos/projection.py +655 -0
- loopx/control_plane/todos/quota_summary.py +1138 -0
- loopx/control_plane/todos/route_continuation.py +267 -0
- loopx/control_plane/todos/succession_warning.py +174 -0
- loopx/control_plane/todos/summary_item.py +223 -0
- loopx/control_plane/todos/text.py +30 -0
- loopx/control_plane/todos/todo_index.py +226 -0
- loopx/control_plane/todos/todo_summary.py +1458 -0
- loopx/control_plane/todos/unblock_resume.py +326 -0
- loopx/control_plane/todos/user_gate.py +263 -0
- loopx/control_plane/todos/write_hint.py +63 -0
- loopx/control_plane/todos/write_policy.py +135 -0
- loopx/control_plane/turn_driver/__init__.py +85 -0
- loopx/control_plane/turn_driver/codex_cli.py +502 -0
- loopx/control_plane/turn_driver/driver.py +355 -0
- loopx/control_plane/turn_driver/executor.py +1468 -0
- loopx/control_plane/turn_driver/loop_controller.py +669 -0
- loopx/control_plane/turn_driver/settlement.py +318 -0
- loopx/control_plane/turn_driver/transaction.py +375 -0
- loopx/control_plane/work_items/__init__.py +1 -0
- loopx/control_plane/work_items/attention_fields.py +56 -0
- loopx/control_plane/work_items/attention_item.py +77 -0
- loopx/control_plane/work_items/attention_queue.py +322 -0
- loopx/control_plane/work_items/attention_routing.py +213 -0
- loopx/control_plane/work_items/autonomous_candidates.py +135 -0
- loopx/control_plane/work_items/autonomous_replan_ack.py +276 -0
- loopx/control_plane/work_items/autonomous_replan_obligation.py +786 -0
- loopx/control_plane/work_items/backlog_hygiene.py +59 -0
- loopx/control_plane/work_items/capability_monitor_fallback.py +221 -0
- loopx/control_plane/work_items/delivery_batch_scale.py +66 -0
- loopx/control_plane/work_items/delivery_outcome.py +152 -0
- loopx/control_plane/work_items/delivery_signals.py +113 -0
- loopx/control_plane/work_items/execution_obligation.py +235 -0
- loopx/control_plane/work_items/goal_route_hint.py +320 -0
- loopx/control_plane/work_items/interaction_contract.py +1540 -0
- loopx/control_plane/work_items/issue_meta_surface.py +159 -0
- loopx/control_plane/work_items/lifecycle.py +139 -0
- loopx/control_plane/work_items/operator_inbox.py +266 -0
- loopx/control_plane/work_items/outcome_followthrough.py +69 -0
- loopx/control_plane/work_items/primary_action.py +326 -0
- loopx/control_plane/work_items/progress_observation.py +630 -0
- loopx/control_plane/work_items/project_asset.py +675 -0
- loopx/control_plane/work_items/repair_delta.py +693 -0
- loopx/control_plane/work_items/runtime_capability_reentry.py +168 -0
- loopx/control_plane/work_items/semantic_replan_writeback.py +177 -0
- loopx/control_plane/work_items/status_contract.py +49 -0
- loopx/control_plane/work_items/task_graph.py +1046 -0
- loopx/control_plane/work_items/task_lease.py +1254 -0
- loopx/control_plane/work_items/task_lease_settlement.py +422 -0
- loopx/control_plane/work_items/work_lane.py +510 -0
- loopx/control_plane/work_items/work_lane_context.py +161 -0
- loopx/demo.py +247 -0
- loopx/diagnose.py +633 -0
- loopx/doctor.py +1251 -0
- loopx/domain_packs/__init__.py +1 -0
- loopx/domain_packs/issue_fix.py +571 -0
- loopx/domain_packs/ml_experiment.py +854 -0
- loopx/domain_state.py +137 -0
- loopx/dreaming.py +706 -0
- loopx/entrypoint.py +16 -0
- loopx/event_sourced_state.py +981 -0
- loopx/execution_profile.py +286 -0
- loopx/experiments/__init__.py +1 -0
- loopx/experiments/planner_worker/__init__.py +1 -0
- loopx/experiments/planner_worker/contract.py +523 -0
- loopx/experiments/planner_worker/runtime.py +391 -0
- loopx/experiments/planner_worker/traex.py +461 -0
- loopx/explore_graph.py +11 -0
- loopx/extensions/__init__.py +1 -0
- loopx/extensions/bundled.py +28 -0
- loopx/extensions/execution_envelope.py +126 -0
- loopx/extensions/lark/__init__.py +11 -0
- loopx/extensions/lark/event_collector.py +478 -0
- loopx/extensions/lark/event_collector_runtime.py +506 -0
- loopx/extensions/lark/event_inbox.py +454 -0
- loopx/extensions/lark/extension.toml +88 -0
- loopx/extensions/lark/goal_channel.py +44 -0
- loopx/extensions/lark/goal_channel_contracts.py +388 -0
- loopx/extensions/lark/goal_channel_lifecycle.py +218 -0
- loopx/extensions/lark/goal_channel_runtime.py +792 -0
- loopx/extensions/lark/goal_channel_setup.py +805 -0
- loopx/extensions/lark/goal_channel_targets.py +215 -0
- loopx/extensions/lark/goal_channel_transport.py +281 -0
- loopx/extensions/lark/inbox_reactions.py +650 -0
- loopx/extensions/lark/inbox_reply.py +430 -0
- loopx/extensions/lark/presentation/__init__.py +11 -0
- loopx/extensions/lark/presentation/explore_results.py +2276 -0
- loopx/extensions/lark/presentation/explore_singleflight.py +127 -0
- loopx/extensions/lark/presentation/explore_source_guard.py +121 -0
- loopx/extensions/lark/presentation/explore_stage_document.py +703 -0
- loopx/extensions/lark/presentation/explore_visual_integrity.py +122 -0
- loopx/extensions/lark/presentation/explore_visual_readback.py +452 -0
- loopx/extensions/lark/presentation/explore_visual_styles.py +156 -0
- loopx/extensions/lark/presentation/issue_fix_surface.py +612 -0
- loopx/extensions/lark/presentation/kanban.py +2791 -0
- loopx/extensions/lark/presentation/message_card.py +112 -0
- loopx/extensions/lark/presentation/periodic_report.py +261 -0
- loopx/extensions/lark/presentation/projection_rows.py +600 -0
- loopx/extensions/lark/presentation/record_io.py +95 -0
- loopx/extensions/lark/presentation/sync_receipt.py +145 -0
- loopx/extensions/lark/private_json.py +40 -0
- loopx/extensions/lark/provider.py +86 -0
- loopx/extensions/lark/reviewer_notification.py +604 -0
- loopx/extensions/manifest.py +385 -0
- loopx/extensions/openviking_periodic_report/__init__.py +17 -0
- loopx/extensions/openviking_periodic_report/activation.py +173 -0
- loopx/extensions/openviking_periodic_report/extension.toml +17 -0
- loopx/extensions/openviking_periodic_report/provider.py +355 -0
- loopx/extensions/openviking_periodic_report/sink.py +117 -0
- loopx/extensions/openviking_semantic_preference/__init__.py +5 -0
- loopx/extensions/openviking_semantic_preference/extension.toml +16 -0
- loopx/extensions/openviking_semantic_preference/history_export.py +484 -0
- loopx/extensions/openviking_semantic_preference/project_peer.py +68 -0
- loopx/extensions/openviking_semantic_preference/provider.py +312 -0
- loopx/extensions/presentation.py +979 -0
- loopx/extensions/process_runtime.py +204 -0
- loopx/extensions/readiness.py +168 -0
- loopx/extensions/runtime.py +931 -0
- loopx/extensions/scaffold.py +335 -0
- loopx/feedback.py +581 -0
- loopx/file_lock.py +382 -0
- loopx/global_registry.py +842 -0
- loopx/global_risks.py +970 -0
- loopx/global_todos.py +568 -0
- loopx/handoff_budget.py +28 -0
- loopx/heartbeat_prequota.py +80 -0
- loopx/heartbeat_prompt.py +159 -0
- loopx/help_surface.py +516 -0
- loopx/history.py +1507 -0
- loopx/host_loop_activation.py +1311 -0
- loopx/host_mode_planner.py +991 -0
- loopx/install_contract.py +1 -0
- loopx/interface_budget.py +196 -0
- loopx/long_task_cadence.py +208 -0
- loopx/materials.py +185 -0
- loopx/ml_experiment.py +3 -0
- loopx/onboarding.py +214 -0
- loopx/opencode2_goal_mode/README.md +81 -0
- loopx/opencode2_goal_mode/__init__.py +9 -0
- loopx/opencode2_goal_mode/opencode2-goal-worker.mjs +1018 -0
- loopx/opencode_goal_mode/README.md +99 -0
- loopx/opencode_goal_mode/__init__.py +13 -0
- loopx/opencode_goal_mode/goal-bridge-runtime.mjs +858 -0
- loopx/opencode_goal_mode/loopx-goal.js +8 -0
- loopx/operator_gate.py +420 -0
- loopx/orchestration.py +127 -0
- loopx/paths.py +59 -0
- loopx/pi_goal_mode/README.md +67 -0
- loopx/pi_goal_mode/__init__.py +13 -0
- loopx/pi_goal_mode/loopx-goal.ts +254 -0
- loopx/pi_goal_mode/pi-goal-loop-runtime.mjs +574 -0
- loopx/pr_review.py +1206 -0
- loopx/presentation/__init__.py +1 -0
- loopx/presentation/explore_views.py +1334 -0
- loopx/presentation/markdown.py +61 -0
- loopx/presentation/projection_source_reconcile.py +140 -0
- loopx/presentation/public_safety.py +42 -0
- loopx/presentation/renderers/__init__.py +17 -0
- loopx/presentation/renderers/goal_channel_html.py +269 -0
- loopx/presentation/renderers/periodic_report_html.py +786 -0
- loopx/presentation/renderers/periodic_report_markdown.py +184 -0
- loopx/presentation/renderers/quota_event_markdown.py +116 -0
- loopx/presentation/renderers/quota_markdown.py +1112 -0
- loopx/presentation/renderers/status_markdown.py +1570 -0
- loopx/presentation/renderers/trajectory_hygiene_markdown.py +39 -0
- loopx/presentation/renderers/turn_envelope_markdown.py +33 -0
- loopx/presentation/sinks/__init__.py +5 -0
- loopx/presentation/sinks/openviking_periodic_report.py +7 -0
- loopx/presentation/static_site.py +691 -0
- loopx/presets.py +369 -0
- loopx/project_alias.py +217 -0
- loopx/project_map.py +589 -0
- loopx/project_prompt.py +1153 -0
- loopx/project_skill_cli.py +125 -0
- loopx/project_skill_delivery.py +470 -0
- loopx/project_uninstall.py +462 -0
- loopx/promotion_gate.py +197 -0
- loopx/quota.py +1197 -0
- loopx/ready_score.py +413 -0
- loopx/registry.py +621 -0
- loopx/registry_writability.py +64 -0
- loopx/release_candidate.py +148 -0
- loopx/release_manifest.py +316 -0
- loopx/repository_identity.py +100 -0
- loopx/review_packet.py +1024 -0
- loopx/rollout_event_log.py +505 -0
- loopx/runtime.py +112 -0
- loopx/self_update.py +750 -0
- loopx/session_runtime.py +418 -0
- loopx/skill_install_readback.py +500 -0
- loopx/slash_command_install.py +1393 -0
- loopx/slash_commands.py +264 -0
- loopx/state_backup.py +573 -0
- loopx/state_migration.py +350 -0
- loopx/state_projection.py +809 -0
- loopx/state_refresh.py +1416 -0
- loopx/status.py +1383 -0
- loopx/status_server.py +935 -0
- loopx/summary_all.py +725 -0
- loopx/terminal_bench_agent.py +2056 -0
- loopx/thread_agent_binding.py +408 -0
- loopx/todo_followups.py +168 -0
- loopx/todo_suggestion_prompt.py +204 -0
- loopx/todos.py +2229 -0
- loopx/turn_identity.py +17 -0
- loopx/upgrade.py +1083 -0
- loopx/visible_governance.py +667 -0
- loopx/visible_multi_agent_launcher.py +1253 -0
- loopx/visible_multi_agent_tmux.py +429 -0
- loopx/worker_bridge.py +1574 -0
- loopx-0.4.8.dist-info/METADATA +708 -0
- loopx-0.4.8.dist-info/RECORD +811 -0
- loopx-0.4.8.dist-info/WHEEL +5 -0
- loopx-0.4.8.dist-info/entry_points.txt +5 -0
- loopx-0.4.8.dist-info/licenses/LICENSE +202 -0
- loopx-0.4.8.dist-info/licenses/LICENSE-MIT +21 -0
- loopx-0.4.8.dist-info/licenses/NOTICE +6 -0
- loopx-0.4.8.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,786 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import hashlib
|
|
4
|
+
import json
|
|
5
|
+
from collections.abc import Mapping, Sequence
|
|
6
|
+
from html import escape
|
|
7
|
+
from typing import Any
|
|
8
|
+
from urllib.parse import urlparse
|
|
9
|
+
|
|
10
|
+
from ...capabilities.periodic_report.adapters import (
|
|
11
|
+
ARTIFACT_SCHEMA,
|
|
12
|
+
DOCUMENT_SCHEMA,
|
|
13
|
+
PeriodicReportRendererAdapter,
|
|
14
|
+
validate_periodic_report_editorial,
|
|
15
|
+
)
|
|
16
|
+
from ..public_safety import redact_public_text
|
|
17
|
+
from .periodic_report_markdown import (
|
|
18
|
+
periodic_report_labels,
|
|
19
|
+
render_periodic_report_markdown,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _mapping(value: object) -> dict[str, Any]:
|
|
24
|
+
return dict(value) if isinstance(value, Mapping) else {}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _items(value: object) -> list[dict[str, Any]]:
|
|
28
|
+
if not isinstance(value, Sequence) or isinstance(value, (str, bytes)):
|
|
29
|
+
return []
|
|
30
|
+
return [dict(item) for item in value if isinstance(item, Mapping)]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _safe_text(value: object, *, maximum: int) -> str:
|
|
34
|
+
return escape(str(redact_public_text(value, limit=maximum)))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _safe_attr(value: object, *, maximum: int) -> str:
|
|
38
|
+
return escape(str(redact_public_text(value, limit=maximum)), quote=True)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _safe_http_url(value: object) -> str | None:
|
|
42
|
+
raw = str(redact_public_text(value, limit=500))
|
|
43
|
+
parsed = urlparse(raw)
|
|
44
|
+
if parsed.scheme not in {"http", "https"} or not parsed.netloc:
|
|
45
|
+
return None
|
|
46
|
+
return escape(raw, quote=True)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _document_digest(document: Mapping[str, Any]) -> str:
|
|
50
|
+
payload = json.dumps(
|
|
51
|
+
document,
|
|
52
|
+
ensure_ascii=False,
|
|
53
|
+
sort_keys=True,
|
|
54
|
+
separators=(",", ":"),
|
|
55
|
+
).encode("utf-8")
|
|
56
|
+
return hashlib.sha256(payload).hexdigest()
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _embedded_json(value: object) -> str:
|
|
60
|
+
return (
|
|
61
|
+
json.dumps(value, ensure_ascii=False)
|
|
62
|
+
.replace("<", "\\u003c")
|
|
63
|
+
.replace(">", "\\u003e")
|
|
64
|
+
.replace("&", "\\u0026")
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _visibility(item: Mapping[str, Any]) -> str:
|
|
69
|
+
return str(item.get("visibility") or "primary")
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _html_labels(language: object) -> dict[str, str]:
|
|
73
|
+
labels = periodic_report_labels(language)
|
|
74
|
+
if str(language or "").lower().startswith("zh"):
|
|
75
|
+
labels.update(
|
|
76
|
+
{
|
|
77
|
+
"default_kicker": "周期报告",
|
|
78
|
+
"all_sections": "全部章节",
|
|
79
|
+
"report_index": "报告目录",
|
|
80
|
+
"filter_placeholder": "搜索报告内容",
|
|
81
|
+
"filter_aria": "搜索报告条目",
|
|
82
|
+
"copy_markdown": "复制完整文字版",
|
|
83
|
+
"print_pdf": "打印 / 存为 PDF",
|
|
84
|
+
"report": "报告",
|
|
85
|
+
"item_count": "{count} 项",
|
|
86
|
+
"no_items_section": "本章节暂无条目。",
|
|
87
|
+
"source_link": "查看来源 ↗",
|
|
88
|
+
"supporting_context": "附录:投递与运行信息",
|
|
89
|
+
"operational_notes": "运行说明",
|
|
90
|
+
"profile": "报告配置",
|
|
91
|
+
"generated": "生成时间",
|
|
92
|
+
"document": "报告摘要",
|
|
93
|
+
"markdown": "文字版摘要",
|
|
94
|
+
"source": "来源",
|
|
95
|
+
"status": "状态",
|
|
96
|
+
"items": "条目数",
|
|
97
|
+
"snapshot": "快照",
|
|
98
|
+
"no_source_receipts": "暂无来源回执。",
|
|
99
|
+
"facts_aria": "报告概览",
|
|
100
|
+
"sections": "章节",
|
|
101
|
+
"sources": "来源",
|
|
102
|
+
"copy_success": "完整文字版已复制",
|
|
103
|
+
"copy_failed": "复制失败",
|
|
104
|
+
"content_kind_delivery_receipt": "投递回执",
|
|
105
|
+
"content_kind_runtime": "运行状态",
|
|
106
|
+
"content_kind_supporting": "补充说明",
|
|
107
|
+
"source_status_complete": "完整",
|
|
108
|
+
"source_status_partial": "部分",
|
|
109
|
+
"source_status_failed": "失败",
|
|
110
|
+
"source_status_unknown": "未知",
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
return labels
|
|
114
|
+
labels.update(
|
|
115
|
+
{
|
|
116
|
+
"default_kicker": "Periodic report",
|
|
117
|
+
"all_sections": "All sections",
|
|
118
|
+
"report_index": "Report index",
|
|
119
|
+
"filter_placeholder": "Filter report",
|
|
120
|
+
"filter_aria": "Filter report items",
|
|
121
|
+
"copy_markdown": "Copy full report",
|
|
122
|
+
"print_pdf": "Print / PDF",
|
|
123
|
+
"report": "Report",
|
|
124
|
+
"item_count": "{count} items",
|
|
125
|
+
"no_items_section": "No items in this section.",
|
|
126
|
+
"source_link": "Source ↗",
|
|
127
|
+
"supporting_context": "Appendix: delivery and runtime context",
|
|
128
|
+
"operational_notes": "Operational notes",
|
|
129
|
+
"profile": "Profile",
|
|
130
|
+
"generated": "Generated",
|
|
131
|
+
"document": "Document",
|
|
132
|
+
"markdown": "Markdown",
|
|
133
|
+
"source": "Source",
|
|
134
|
+
"status": "Status",
|
|
135
|
+
"items": "Items",
|
|
136
|
+
"snapshot": "Snapshot",
|
|
137
|
+
"no_source_receipts": "No source receipts.",
|
|
138
|
+
"facts_aria": "Report facts",
|
|
139
|
+
"sections": "Sections",
|
|
140
|
+
"sources": "Sources",
|
|
141
|
+
"copy_success": "Full report copied",
|
|
142
|
+
"copy_failed": "Copy failed",
|
|
143
|
+
"content_kind_delivery_receipt": "Delivery receipt",
|
|
144
|
+
"content_kind_runtime": "Runtime",
|
|
145
|
+
"content_kind_supporting": "Supporting note",
|
|
146
|
+
"source_status_complete": "Complete",
|
|
147
|
+
"source_status_partial": "Partial",
|
|
148
|
+
"source_status_failed": "Failed",
|
|
149
|
+
"source_status_unknown": "Unknown",
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
return labels
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def _primary_items(section: Mapping[str, Any]) -> list[dict[str, Any]]:
|
|
156
|
+
return [
|
|
157
|
+
item for item in _items(section.get("items")) if _visibility(item) == "primary"
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def _supporting_items(section: Mapping[str, Any]) -> list[dict[str, Any]]:
|
|
162
|
+
return [
|
|
163
|
+
item
|
|
164
|
+
for item in _items(section.get("items"))
|
|
165
|
+
if _visibility(item) == "supporting"
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def _render_tags(item: Mapping[str, Any]) -> str:
|
|
170
|
+
value = item.get("tags")
|
|
171
|
+
tag_labels = _mapping(item.get("tag_labels"))
|
|
172
|
+
tags = (
|
|
173
|
+
[
|
|
174
|
+
_safe_text(tag_labels.get(tag) or tag, maximum=128)
|
|
175
|
+
for tag in value
|
|
176
|
+
if isinstance(tag, str) and tag.strip()
|
|
177
|
+
]
|
|
178
|
+
if isinstance(value, Sequence) and not isinstance(value, (str, bytes))
|
|
179
|
+
else []
|
|
180
|
+
)
|
|
181
|
+
if not tags:
|
|
182
|
+
return ""
|
|
183
|
+
return (
|
|
184
|
+
'<span class="tags">'
|
|
185
|
+
+ "".join(f'<span class="tag">{tag}</span>' for tag in tags)
|
|
186
|
+
+ "</span>"
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _render_details(value: object) -> str:
|
|
191
|
+
details = _items(value)
|
|
192
|
+
if not details:
|
|
193
|
+
return ""
|
|
194
|
+
rows = []
|
|
195
|
+
for detail in details:
|
|
196
|
+
rows.append(
|
|
197
|
+
'<div class="item-detail">'
|
|
198
|
+
f'<dt>{_safe_text(detail.get("label"), maximum=40)}</dt>'
|
|
199
|
+
f'<dd>{_safe_text(detail.get("text"), maximum=500)}</dd>'
|
|
200
|
+
"</div>"
|
|
201
|
+
)
|
|
202
|
+
return f'<dl class="item-details">{"".join(rows)}</dl>'
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def _render_item(
|
|
206
|
+
item: Mapping[str, Any],
|
|
207
|
+
*,
|
|
208
|
+
index: int,
|
|
209
|
+
labels: Mapping[str, str],
|
|
210
|
+
) -> str:
|
|
211
|
+
title = _safe_text(item.get("title"), maximum=240)
|
|
212
|
+
summary = _safe_text(item.get("summary"), maximum=1000)
|
|
213
|
+
status = _safe_text(item.get("status"), maximum=80)
|
|
214
|
+
next_action = _safe_text(item.get("next_action"), maximum=500)
|
|
215
|
+
source_ref = item.get("source_ref")
|
|
216
|
+
source_url = _safe_http_url(source_ref)
|
|
217
|
+
content_kind = _safe_attr(item.get("content_kind") or "unspecified", maximum=128)
|
|
218
|
+
search_text = " ".join(
|
|
219
|
+
str(item.get(field) or "")
|
|
220
|
+
for field in (
|
|
221
|
+
"title",
|
|
222
|
+
"summary",
|
|
223
|
+
"status",
|
|
224
|
+
"source_id",
|
|
225
|
+
"next_action",
|
|
226
|
+
"tags",
|
|
227
|
+
"tag_labels",
|
|
228
|
+
"details",
|
|
229
|
+
)
|
|
230
|
+
)
|
|
231
|
+
kicker = ""
|
|
232
|
+
if status:
|
|
233
|
+
kicker += f'<span class="status">{status}</span>'
|
|
234
|
+
kicker += _render_tags(item)
|
|
235
|
+
next_block = ""
|
|
236
|
+
if next_action:
|
|
237
|
+
next_block = (
|
|
238
|
+
f'<div class="next-action"><span>{labels["next"]}</span>'
|
|
239
|
+
f"<p>{next_action}</p></div>"
|
|
240
|
+
)
|
|
241
|
+
if source_url:
|
|
242
|
+
source = (
|
|
243
|
+
f'<a class="source-link" href="{source_url}" '
|
|
244
|
+
'target="_blank" rel="noopener noreferrer">'
|
|
245
|
+
f'{labels["source_link"]}</a>'
|
|
246
|
+
)
|
|
247
|
+
elif source_ref:
|
|
248
|
+
source = (
|
|
249
|
+
f'<span class="source-ref">{_safe_text(source_ref, maximum=500)}</span>'
|
|
250
|
+
)
|
|
251
|
+
else:
|
|
252
|
+
source = ""
|
|
253
|
+
footer = f'<div class="item-footer">{source}</div>' if source else ""
|
|
254
|
+
return (
|
|
255
|
+
f'<article class="report-row" data-content-kind="{content_kind}" '
|
|
256
|
+
f'data-search="{_safe_attr(search_text, maximum=2200)}">'
|
|
257
|
+
f'<div class="row-index">{index:02d}</div>'
|
|
258
|
+
'<div class="row-main">'
|
|
259
|
+
f'<div class="row-kicker">{kicker}</div>'
|
|
260
|
+
f"<h3>{title}</h3>"
|
|
261
|
+
f'<p class="summary">{summary}</p>'
|
|
262
|
+
f"{_render_details(item.get('details'))}"
|
|
263
|
+
f"{next_block}{footer}"
|
|
264
|
+
"</div></article>"
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
def _render_section(
|
|
269
|
+
section: Mapping[str, Any],
|
|
270
|
+
*,
|
|
271
|
+
section_index: int,
|
|
272
|
+
item_start: int,
|
|
273
|
+
labels: Mapping[str, str],
|
|
274
|
+
) -> tuple[str, int]:
|
|
275
|
+
section_id = _safe_attr(section.get("section_id"), maximum=128)
|
|
276
|
+
title = _safe_text(section.get("title"), maximum=160)
|
|
277
|
+
items = _primary_items(section)
|
|
278
|
+
rows = "".join(
|
|
279
|
+
_render_item(item, index=item_start + offset, labels=labels)
|
|
280
|
+
for offset, item in enumerate(items)
|
|
281
|
+
)
|
|
282
|
+
if not rows:
|
|
283
|
+
rows = f'<p class="empty">{labels["no_items_section"]}</p>'
|
|
284
|
+
content = (
|
|
285
|
+
f'<section class="report-section" id="section-{section_id}" '
|
|
286
|
+
f'data-section="{section_id}">'
|
|
287
|
+
'<div class="section-heading"><div>'
|
|
288
|
+
f'<p class="eyebrow">{section_index:02d} / {labels["report"]}</p>'
|
|
289
|
+
f"<h2>{title}</h2></div>"
|
|
290
|
+
f'<span class="section-count">{labels["item_count"].format(count=len(items))}</span>'
|
|
291
|
+
f'</div><div class="rows">{rows}</div></section>'
|
|
292
|
+
)
|
|
293
|
+
return content, item_start + len(items)
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
def _render_supporting_sections(
|
|
297
|
+
sections: Sequence[Mapping[str, Any]],
|
|
298
|
+
*,
|
|
299
|
+
labels: Mapping[str, str],
|
|
300
|
+
) -> str:
|
|
301
|
+
groups = []
|
|
302
|
+
for section in sections:
|
|
303
|
+
items = _supporting_items(section)
|
|
304
|
+
if not items:
|
|
305
|
+
continue
|
|
306
|
+
notes = []
|
|
307
|
+
for item in items:
|
|
308
|
+
status = _safe_text(item.get("status"), maximum=80)
|
|
309
|
+
raw_kind = str(item.get("content_kind") or "supporting")
|
|
310
|
+
kind = _safe_text(
|
|
311
|
+
labels.get(f"content_kind_{raw_kind}") or raw_kind,
|
|
312
|
+
maximum=128,
|
|
313
|
+
)
|
|
314
|
+
label = " · ".join(value for value in (kind, status) if value)
|
|
315
|
+
next_action = _safe_text(item.get("next_action"), maximum=500)
|
|
316
|
+
source_url = _safe_http_url(item.get("source_ref"))
|
|
317
|
+
source = (
|
|
318
|
+
f'<a href="{source_url}" target="_blank" '
|
|
319
|
+
'rel="noopener noreferrer">Source ↗</a>'
|
|
320
|
+
if source_url
|
|
321
|
+
else ""
|
|
322
|
+
)
|
|
323
|
+
notes.append(
|
|
324
|
+
'<article class="supporting-note">'
|
|
325
|
+
f'<p class="supporting-label">{label}</p>'
|
|
326
|
+
f"<h4>{_safe_text(item.get('title'), maximum=240)}</h4>"
|
|
327
|
+
f"<p>{_safe_text(item.get('summary'), maximum=1000)}</p>"
|
|
328
|
+
+ (
|
|
329
|
+
f'<p><strong>{labels["next"]}{labels["label_separator"]}</strong> {next_action}</p>'
|
|
330
|
+
if next_action
|
|
331
|
+
else ""
|
|
332
|
+
)
|
|
333
|
+
+ source
|
|
334
|
+
+ "</article>"
|
|
335
|
+
)
|
|
336
|
+
groups.append(
|
|
337
|
+
'<section class="supporting-section">'
|
|
338
|
+
f"<h3>{_safe_text(section.get('title'), maximum=160)}</h3>"
|
|
339
|
+
f"{''.join(notes)}</section>"
|
|
340
|
+
)
|
|
341
|
+
if not groups:
|
|
342
|
+
return ""
|
|
343
|
+
return (
|
|
344
|
+
f'<div class="supporting-sections"><h3>{labels["operational_notes"]}</h3>'
|
|
345
|
+
+ "".join(groups)
|
|
346
|
+
+ "</div>"
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
def _render_source_receipts(
|
|
351
|
+
sources: Sequence[Mapping[str, Any]],
|
|
352
|
+
*,
|
|
353
|
+
labels: Mapping[str, str],
|
|
354
|
+
) -> str:
|
|
355
|
+
rows = []
|
|
356
|
+
for source in sources:
|
|
357
|
+
rows.append(
|
|
358
|
+
"<tr>"
|
|
359
|
+
f'<th scope="row">{_safe_text(source.get("source_id"), maximum=128)}</th>'
|
|
360
|
+
f"<td>{_safe_text(labels.get('source_status_' + str(source.get('status'))) or source.get('status'), maximum=80)}</td>"
|
|
361
|
+
f"<td>{_safe_text(source.get('item_count'), maximum=40)}</td>"
|
|
362
|
+
f"<td><code>{_safe_text(source.get('snapshot_digest'), maximum=128)}</code></td>"
|
|
363
|
+
"</tr>"
|
|
364
|
+
)
|
|
365
|
+
if not rows:
|
|
366
|
+
return f'<p class="empty">{labels["no_source_receipts"]}</p>'
|
|
367
|
+
return (
|
|
368
|
+
'<div class="table-wrap"><table><thead><tr>'
|
|
369
|
+
f'<th>{labels["source"]}</th><th>{labels["status"]}</th>'
|
|
370
|
+
f'<th>{labels["items"]}</th><th>{labels["snapshot"]}</th>'
|
|
371
|
+
f"</tr></thead><tbody>{''.join(rows)}</tbody></table></div>"
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
_CSS = """
|
|
376
|
+
:root {
|
|
377
|
+
color-scheme: light;
|
|
378
|
+
--ivory: #faf9f5;
|
|
379
|
+
--ink: #171714;
|
|
380
|
+
--paper: #ffffff;
|
|
381
|
+
--clay: #d97757;
|
|
382
|
+
--oat: #e3dacc;
|
|
383
|
+
--line: #d1cfc5;
|
|
384
|
+
--muted: #77766f;
|
|
385
|
+
--soft: #f0eee6;
|
|
386
|
+
--serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
|
|
387
|
+
--sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
|
388
|
+
"Segoe UI", sans-serif;
|
|
389
|
+
--mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
|
|
390
|
+
background: var(--ivory);
|
|
391
|
+
color: var(--ink);
|
|
392
|
+
font-family: var(--sans);
|
|
393
|
+
}
|
|
394
|
+
* { box-sizing: border-box; }
|
|
395
|
+
html { scroll-behavior: smooth; }
|
|
396
|
+
body { margin: 0; min-width: 300px; font-size: 15px; line-height: 1.65; }
|
|
397
|
+
button, input { font: inherit; }
|
|
398
|
+
.shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 40px 0 80px; }
|
|
399
|
+
.masthead { border-top: 8px solid var(--ink); border-bottom: 1.5px solid var(--ink);
|
|
400
|
+
padding: 27px 0 26px; }
|
|
401
|
+
.mast-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px;
|
|
402
|
+
align-items: end; }
|
|
403
|
+
.eyebrow { margin: 0 0 8px; color: var(--muted); font: 650 10px/1.4 var(--mono);
|
|
404
|
+
letter-spacing: .1em; text-transform: uppercase; }
|
|
405
|
+
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.018em; }
|
|
406
|
+
h1 { max-width: 900px; margin: 0; font-size: clamp(39px, 6vw, 72px); line-height: .98; }
|
|
407
|
+
.period { margin: 18px 0 0; color: #454541; font-size: 15px; }
|
|
408
|
+
.mast-summary { max-width: 820px; margin: 18px 0 0; color: #3f3f3a; font-size: 16px;
|
|
409
|
+
line-height: 1.72; }
|
|
410
|
+
.report-facts { display: grid; grid-template-columns: repeat(2, minmax(112px, 1fr)); gap: 1px;
|
|
411
|
+
border: 1px solid var(--line); background: var(--line); }
|
|
412
|
+
.report-facts.fallback { grid-template-columns: repeat(3, minmax(78px, 1fr)); }
|
|
413
|
+
.fact { min-width: 112px; padding: 13px 14px; background: var(--paper); }
|
|
414
|
+
.fact[data-tone="attention"] { box-shadow: inset 3px 0 0 var(--clay); }
|
|
415
|
+
.fact strong { display: block; font: 500 28px/1 var(--serif); }
|
|
416
|
+
.fact span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px;
|
|
417
|
+
letter-spacing: .04em; text-transform: uppercase; }
|
|
418
|
+
.fact small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px;
|
|
419
|
+
line-height: 1.35; }
|
|
420
|
+
.layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 48px;
|
|
421
|
+
margin-top: 44px; }
|
|
422
|
+
.rail { position: sticky; top: 18px; align-self: start; }
|
|
423
|
+
.rail-label { margin: 0 0 10px; color: var(--muted); font: 650 10px/1.4 var(--mono);
|
|
424
|
+
letter-spacing: .09em; text-transform: uppercase; }
|
|
425
|
+
.rail nav { display: grid; border-top: 1px solid var(--line); }
|
|
426
|
+
.section-filter { display: grid; grid-template-columns: 26px 1fr; gap: 8px; width: 100%;
|
|
427
|
+
border: 0; border-bottom: 1px solid var(--line); padding: 10px 2px; background: transparent;
|
|
428
|
+
color: #3e3e3a; cursor: pointer; text-align: left; font-size: 13px; text-decoration: none; }
|
|
429
|
+
.section-filter span { color: var(--muted); font: 10px/1.7 var(--mono); }
|
|
430
|
+
.section-filter[aria-current="true"] { color: var(--clay); }
|
|
431
|
+
.search { width: 100%; margin-top: 15px; border: 1px solid var(--line); border-radius: 8px;
|
|
432
|
+
padding: 9px 10px; background: var(--paper); color: var(--ink); font-size: 12px; }
|
|
433
|
+
.tools { display: grid; grid-template-columns: 1fr; gap: 7px; margin-top: 9px; }
|
|
434
|
+
.tool { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
|
|
435
|
+
background: var(--paper); color: var(--ink); cursor: pointer; text-align: left; font-size: 12px; }
|
|
436
|
+
.tool:hover, .search:focus { border-color: var(--ink); outline: none; }
|
|
437
|
+
.report-section { margin-bottom: 58px; scroll-margin-top: 20px; }
|
|
438
|
+
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end;
|
|
439
|
+
padding-bottom: 13px; border-bottom: 2px solid var(--ink); }
|
|
440
|
+
h2 { margin: 0; font-size: 33px; line-height: 1.05; }
|
|
441
|
+
.section-count { color: var(--muted); font: 11px/1.4 var(--mono); white-space: nowrap; }
|
|
442
|
+
.rows { border-bottom: 1px solid var(--line); }
|
|
443
|
+
.report-row { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 18px;
|
|
444
|
+
padding: 24px 0; border-top: 1px solid var(--line); }
|
|
445
|
+
.report-row:first-child { border-top: 0; }
|
|
446
|
+
.row-index { color: var(--line); font: 500 28px/1 var(--serif); }
|
|
447
|
+
.row-kicker { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; min-height: 20px;
|
|
448
|
+
margin-bottom: 6px; }
|
|
449
|
+
.status { border-radius: 999px; padding: 2px 8px; background: var(--oat); color: #454541;
|
|
450
|
+
font: 10px/1.5 var(--mono); }
|
|
451
|
+
.tags { display: inline-flex; flex-wrap: wrap; gap: 5px; }
|
|
452
|
+
.tag { color: var(--muted); font: 9px/1.4 var(--mono); letter-spacing: .04em;
|
|
453
|
+
text-transform: uppercase; }
|
|
454
|
+
.tag + .tag::before { content: "·"; margin-right: 5px; color: var(--line); }
|
|
455
|
+
h3 { margin: 0; font-size: 24px; line-height: 1.2; }
|
|
456
|
+
.summary { max-width: 820px; margin: 9px 0 0; color: #42423e; line-height: 1.72; }
|
|
457
|
+
.item-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
|
|
458
|
+
max-width: 900px; margin: 15px 0 0; border: 1px solid var(--line); padding: 0;
|
|
459
|
+
background: var(--line); }
|
|
460
|
+
.item-detail { min-width: 0; padding: 11px 13px; background: var(--paper); }
|
|
461
|
+
.item-detail dt { margin: 0 0 4px; color: var(--clay); font: 650 10px/1.4 var(--sans); }
|
|
462
|
+
.item-detail dd { margin: 0; color: #4a4a45; font-size: 12px; line-height: 1.65; }
|
|
463
|
+
.next-action { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 11px;
|
|
464
|
+
margin-top: 14px; border-left: 3px solid var(--clay); padding: 7px 0 7px 11px; }
|
|
465
|
+
.next-action span { color: var(--clay); font: 650 9px/1.6 var(--mono); letter-spacing: .06em;
|
|
466
|
+
text-transform: uppercase; }
|
|
467
|
+
.next-action p { margin: 0; color: #4a4a45; font-size: 13px; }
|
|
468
|
+
.item-footer { margin-top: 11px; }
|
|
469
|
+
.source-link, .source-ref { color: var(--clay); font: 650 10px/1.4 var(--mono);
|
|
470
|
+
letter-spacing: .04em; text-decoration: none; overflow-wrap: anywhere; }
|
|
471
|
+
.source-link:hover { text-decoration: underline; }
|
|
472
|
+
.source-ref { color: var(--muted); }
|
|
473
|
+
.supporting { margin: 10px 0 0; border-top: 1px solid var(--line); padding-top: 14px; }
|
|
474
|
+
.supporting > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
|
|
475
|
+
.supporting[open] > summary { color: var(--ink); }
|
|
476
|
+
.supporting-body { margin-top: 13px; border: 1px solid var(--line); border-radius: 10px;
|
|
477
|
+
padding: 14px; background: var(--paper); }
|
|
478
|
+
.metadata { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 14px;
|
|
479
|
+
margin: 0 0 13px; font-size: 11px; }
|
|
480
|
+
.metadata dt { color: var(--muted); }
|
|
481
|
+
.metadata dd { margin: 0; overflow-wrap: anywhere; }
|
|
482
|
+
.metadata code, td code { font: 10px/1.45 var(--mono); }
|
|
483
|
+
.supporting-sections { margin-bottom: 18px; }
|
|
484
|
+
.supporting-sections > h3, .supporting-section > h3 { margin: 0 0 10px; font: 600 13px/1.4 var(--sans); }
|
|
485
|
+
.supporting-section + .supporting-section { margin-top: 16px; }
|
|
486
|
+
.supporting-note { border-top: 1px solid var(--line); padding: 11px 0; }
|
|
487
|
+
.supporting-note h4 { margin: 3px 0 5px; font: 600 13px/1.35 var(--sans); }
|
|
488
|
+
.supporting-note p { margin: 0; color: #4a4a45; font-size: 11px; }
|
|
489
|
+
.supporting-note p + p { margin-top: 5px; }
|
|
490
|
+
.supporting-note a { color: var(--clay); font: 650 10px/1.4 var(--mono); text-decoration: none; }
|
|
491
|
+
.supporting-label { color: var(--muted) !important; font: 10px/1.4 var(--mono) !important;
|
|
492
|
+
text-transform: uppercase; }
|
|
493
|
+
.table-wrap { overflow-x: auto; }
|
|
494
|
+
table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
|
|
495
|
+
th, td { border-top: 1px solid var(--line); padding: 7px 9px; vertical-align: top; }
|
|
496
|
+
thead th { border-top: 0; color: var(--muted); font-weight: 600; }
|
|
497
|
+
.empty { padding: 18px 0; color: var(--muted); }
|
|
498
|
+
.toast { position: fixed; right: 20px; bottom: 20px; transform: translateY(16px);
|
|
499
|
+
opacity: 0; border-radius: 8px; padding: 9px 12px; background: var(--ink); color: #fff;
|
|
500
|
+
font-size: 12px; transition: .18s ease; pointer-events: none; }
|
|
501
|
+
.toast.show { transform: none; opacity: 1; }
|
|
502
|
+
[hidden] { display: none !important; }
|
|
503
|
+
@media (max-width: 820px) {
|
|
504
|
+
.shell { width: min(100% - 26px, 760px); padding-top: 20px; }
|
|
505
|
+
.mast-grid { grid-template-columns: 1fr; }
|
|
506
|
+
.report-facts { width: 100%; }
|
|
507
|
+
.layout { grid-template-columns: 1fr; gap: 32px; }
|
|
508
|
+
.rail { position: static; }
|
|
509
|
+
.rail nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
510
|
+
.tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
511
|
+
}
|
|
512
|
+
@media (max-width: 520px) {
|
|
513
|
+
h1 { font-size: 41px; }
|
|
514
|
+
.report-facts, .report-facts.fallback { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
515
|
+
.fact { min-width: 0; }
|
|
516
|
+
.rail nav, .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
517
|
+
.report-row { grid-template-columns: 34px minmax(0, 1fr); gap: 9px; }
|
|
518
|
+
.item-details { grid-template-columns: 1fr; }
|
|
519
|
+
h3 { font-size: 21px; }
|
|
520
|
+
}
|
|
521
|
+
@media print {
|
|
522
|
+
.rail, .toast, .supporting { display: none !important; }
|
|
523
|
+
.layout { grid-template-columns: 1fr; }
|
|
524
|
+
.shell { width: 100%; padding: 0; }
|
|
525
|
+
body { background: #fff; }
|
|
526
|
+
}
|
|
527
|
+
@media (prefers-reduced-motion: reduce) {
|
|
528
|
+
html { scroll-behavior: auto; }
|
|
529
|
+
.toast { transition: none; }
|
|
530
|
+
}
|
|
531
|
+
"""
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
_SCRIPT = """
|
|
535
|
+
(() => {
|
|
536
|
+
const search = document.querySelector('[data-report-search]');
|
|
537
|
+
const filters = [...document.querySelectorAll('[data-section-filter]')];
|
|
538
|
+
const sections = [...document.querySelectorAll('[data-section]')];
|
|
539
|
+
let active = 'all';
|
|
540
|
+
const apply = () => {
|
|
541
|
+
const query = (search && search.value || '').trim().toLocaleLowerCase();
|
|
542
|
+
sections.forEach((section) => {
|
|
543
|
+
const sectionMatch = active === 'all' || section.dataset.section === active;
|
|
544
|
+
let visible = 0;
|
|
545
|
+
section.querySelectorAll('[data-search]').forEach((item) => {
|
|
546
|
+
const itemMatch = !query || (item.dataset.search || '').toLocaleLowerCase().includes(query);
|
|
547
|
+
item.hidden = !(sectionMatch && itemMatch);
|
|
548
|
+
if (!item.hidden) visible += 1;
|
|
549
|
+
});
|
|
550
|
+
section.hidden = !sectionMatch || visible === 0;
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
if (search) search.addEventListener('input', apply);
|
|
554
|
+
const activate = (candidate) => {
|
|
555
|
+
active = candidate ? candidate.dataset.sectionFilter || 'all' : 'all';
|
|
556
|
+
filters.forEach((candidate) => candidate.setAttribute(
|
|
557
|
+
'aria-current', String(candidate.dataset.sectionFilter === active)
|
|
558
|
+
));
|
|
559
|
+
apply();
|
|
560
|
+
};
|
|
561
|
+
filters.forEach((link) => link.addEventListener('click', () => activate(link)));
|
|
562
|
+
const restoreHash = () => {
|
|
563
|
+
const sectionId = location.hash.startsWith('#section-')
|
|
564
|
+
? location.hash.slice('#section-'.length)
|
|
565
|
+
: '';
|
|
566
|
+
const link = filters.find((candidate) => candidate.dataset.sectionFilter === sectionId);
|
|
567
|
+
if (!link) {
|
|
568
|
+
if (!location.hash || location.hash === '#report-top') activate(filters[0]);
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
activate(link);
|
|
572
|
+
const section = sections.find((candidate) => candidate.dataset.section === sectionId);
|
|
573
|
+
if (section) requestAnimationFrame(() => section.scrollIntoView({block: 'start'}));
|
|
574
|
+
};
|
|
575
|
+
window.addEventListener('hashchange', restoreHash);
|
|
576
|
+
restoreHash();
|
|
577
|
+
const toast = document.querySelector('[data-copy-toast]');
|
|
578
|
+
const copy = document.querySelector('[data-copy-markdown]');
|
|
579
|
+
if (copy) copy.addEventListener('click', async () => {
|
|
580
|
+
const payload = document.querySelector('[data-report-markdown]');
|
|
581
|
+
const text = payload ? JSON.parse(payload.textContent || '\"\"') : '';
|
|
582
|
+
if (toast) {
|
|
583
|
+
toast.textContent = '';
|
|
584
|
+
}
|
|
585
|
+
try {
|
|
586
|
+
await navigator.clipboard.writeText(text);
|
|
587
|
+
if (toast) toast.textContent = toast.dataset.copySuccess || 'Copied';
|
|
588
|
+
} catch (_error) {
|
|
589
|
+
if (toast) toast.textContent = toast.dataset.copyFailed || 'Copy failed';
|
|
590
|
+
}
|
|
591
|
+
if (toast && toast.textContent) {
|
|
592
|
+
toast.classList.add('show');
|
|
593
|
+
window.setTimeout(() => {
|
|
594
|
+
toast.classList.remove('show');
|
|
595
|
+
toast.textContent = '';
|
|
596
|
+
}, 1400);
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
const print = document.querySelector('[data-print-report]');
|
|
600
|
+
if (print) print.addEventListener('click', () => window.print());
|
|
601
|
+
})();
|
|
602
|
+
"""
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
def render_periodic_report_html(document: Mapping[str, Any]) -> dict[str, Any]:
|
|
606
|
+
"""Render one dense, self-contained report without changing its semantics."""
|
|
607
|
+
|
|
608
|
+
if document.get("schema_version") != DOCUMENT_SCHEMA:
|
|
609
|
+
raise ValueError(f"document must use {DOCUMENT_SCHEMA}")
|
|
610
|
+
validate_periodic_report_editorial(document)
|
|
611
|
+
sections = _items(document.get("sections"))
|
|
612
|
+
primary_sections = [
|
|
613
|
+
section
|
|
614
|
+
for section in sections
|
|
615
|
+
if _primary_items(section) or not _items(section.get("items"))
|
|
616
|
+
]
|
|
617
|
+
sources = _items(document.get("source_snapshots"))
|
|
618
|
+
window = _mapping(document.get("period_window"))
|
|
619
|
+
profile = _mapping(document.get("profile"))
|
|
620
|
+
editorial = _mapping(document.get("editorial"))
|
|
621
|
+
editorial_orchestration = _mapping(editorial.get("orchestration"))
|
|
622
|
+
labels = _html_labels(editorial.get("language"))
|
|
623
|
+
title = _safe_text(document.get("title"), maximum=200)
|
|
624
|
+
item_count = sum(len(_primary_items(section)) for section in sections)
|
|
625
|
+
supporting_item_count = sum(len(_supporting_items(section)) for section in sections)
|
|
626
|
+
document_digest = _document_digest(document)
|
|
627
|
+
markdown_artifact = render_periodic_report_markdown(document)
|
|
628
|
+
|
|
629
|
+
filters = [
|
|
630
|
+
'<a class="section-filter" href="#report-top" data-section-filter="all" '
|
|
631
|
+
f'aria-current="true"><span>00</span>{labels["all_sections"]}</a>'
|
|
632
|
+
]
|
|
633
|
+
rendered_sections = []
|
|
634
|
+
next_item_index = 1
|
|
635
|
+
for section_index, section in enumerate(primary_sections, start=1):
|
|
636
|
+
section_id = _safe_attr(section.get("section_id"), maximum=128)
|
|
637
|
+
section_title = _safe_text(section.get("title"), maximum=160)
|
|
638
|
+
filters.append(
|
|
639
|
+
f'<a class="section-filter" href="#section-{section_id}" '
|
|
640
|
+
f'data-section-filter="{section_id}" aria-current="false">'
|
|
641
|
+
f"<span>{section_index:02d}</span>{section_title}</a>"
|
|
642
|
+
)
|
|
643
|
+
section_html, next_item_index = _render_section(
|
|
644
|
+
section,
|
|
645
|
+
section_index=section_index,
|
|
646
|
+
item_start=next_item_index,
|
|
647
|
+
labels=labels,
|
|
648
|
+
)
|
|
649
|
+
rendered_sections.append(section_html)
|
|
650
|
+
|
|
651
|
+
generated_at = _safe_text(document.get("generated_at"), maximum=80)
|
|
652
|
+
profile_id = _safe_text(profile.get("profile_id"), maximum=128)
|
|
653
|
+
profile_version = _safe_text(profile.get("profile_version"), maximum=128)
|
|
654
|
+
language = _safe_attr(editorial.get("language") or "und", maximum=64)
|
|
655
|
+
kicker = _safe_text(
|
|
656
|
+
editorial.get("kicker") or labels["default_kicker"], maximum=120
|
|
657
|
+
)
|
|
658
|
+
summary = _safe_text(editorial.get("summary"), maximum=600)
|
|
659
|
+
period_label = _safe_text(editorial.get("period_label"), maximum=160)
|
|
660
|
+
highlights = _items(editorial.get("highlights"))
|
|
661
|
+
if highlights:
|
|
662
|
+
facts = []
|
|
663
|
+
for highlight in highlights[:4]:
|
|
664
|
+
detail = _safe_text(highlight.get("detail"), maximum=160)
|
|
665
|
+
tone = _safe_attr(highlight.get("tone") or "neutral", maximum=128)
|
|
666
|
+
facts.append(
|
|
667
|
+
f'<div class="fact" data-tone="{tone}">'
|
|
668
|
+
f"<strong>{_safe_text(highlight.get('value'), maximum=48)}</strong>"
|
|
669
|
+
f"<span>{_safe_text(highlight.get('label'), maximum=80)}</span>"
|
|
670
|
+
+ (f"<small>{detail}</small>" if detail else "")
|
|
671
|
+
+ "</div>"
|
|
672
|
+
)
|
|
673
|
+
facts_html = f'<div class="report-facts">{"".join(facts)}</div>'
|
|
674
|
+
else:
|
|
675
|
+
facts_html = (
|
|
676
|
+
'<div class="report-facts fallback" '
|
|
677
|
+
f'aria-label="{_safe_attr(labels["facts_aria"], maximum=80)}">'
|
|
678
|
+
f'<div class="fact"><strong>{len(primary_sections)}</strong><span>{labels["sections"]}</span></div>'
|
|
679
|
+
f'<div class="fact"><strong>{item_count}</strong><span>{labels["items"]}</span></div>'
|
|
680
|
+
f'<div class="fact"><strong>{len(sources)}</strong><span>{labels["sources"]}</span></div>'
|
|
681
|
+
"</div>"
|
|
682
|
+
)
|
|
683
|
+
supporting_sections = _render_supporting_sections(sections, labels=labels)
|
|
684
|
+
content = (
|
|
685
|
+
"<!doctype html>\n"
|
|
686
|
+
f'<html lang="{language}"><head><meta charset="utf-8">'
|
|
687
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">'
|
|
688
|
+
'<meta http-equiv="Content-Security-Policy" '
|
|
689
|
+
"content=\"default-src 'none'; style-src 'unsafe-inline'; "
|
|
690
|
+
"script-src 'unsafe-inline'; img-src data:\">"
|
|
691
|
+
f"<title>{title}</title><style>{_CSS}</style></head><body>"
|
|
692
|
+
'<div class="shell" id="report-top" data-renderer="html_artifact_v0" '
|
|
693
|
+
'data-presentation="editorial_dense_v2">'
|
|
694
|
+
'<header class="masthead"><div class="mast-grid"><div>'
|
|
695
|
+
f'<p class="eyebrow">{kicker}</p>'
|
|
696
|
+
f"<h1>{title}</h1>"
|
|
697
|
+
f'<p class="period">{period_label or (_safe_text(window.get("start_at"), maximum=80) + " — " + _safe_text(window.get("end_at"), maximum=80))}</p>'
|
|
698
|
+
+ (f'<p class="mast-summary">{summary}</p>' if summary else "")
|
|
699
|
+
+ f'</div>{facts_html}</div></header><div class="layout">'
|
|
700
|
+
f'<aside class="rail"><p class="rail-label">{labels["report_index"]}</p><nav>'
|
|
701
|
+
f"{''.join(filters)}</nav>"
|
|
702
|
+
'<input class="search" type="search" data-report-search '
|
|
703
|
+
f'placeholder="{_safe_attr(labels["filter_placeholder"], maximum=80)}" '
|
|
704
|
+
f'aria-label="{_safe_attr(labels["filter_aria"], maximum=80)}">'
|
|
705
|
+
'<div class="tools"><button class="tool" type="button" data-copy-markdown>'
|
|
706
|
+
f'{labels["copy_markdown"]}</button><button class="tool" type="button" '
|
|
707
|
+
f'data-print-report>{labels["print_pdf"]}</button></div></aside><main>'
|
|
708
|
+
f"{''.join(rendered_sections)}"
|
|
709
|
+
'<details class="supporting" data-supporting-context><summary>'
|
|
710
|
+
f'{labels["supporting_context"]}</summary><div class="supporting-body">'
|
|
711
|
+
f"{supporting_sections}"
|
|
712
|
+
'<dl class="metadata">'
|
|
713
|
+
f'<dt>{labels["profile"]}</dt><dd>{profile_id} · {profile_version}</dd>'
|
|
714
|
+
f'<dt>{labels["generated"]}</dt><dd>{generated_at}</dd>'
|
|
715
|
+
f'<dt>{labels["document"]}</dt><dd><code>sha256:{document_digest}</code></dd>'
|
|
716
|
+
f'<dt>{labels["markdown"]}</dt><dd><code>{_safe_text(markdown_artifact["content_digest"], maximum=80)}</code></dd>'
|
|
717
|
+
"</dl>"
|
|
718
|
+
f"{_render_source_receipts(sources, labels=labels)}"
|
|
719
|
+
"</div></details></main></div></div>"
|
|
720
|
+
'<div class="toast" data-copy-toast role="status" aria-live="polite" '
|
|
721
|
+
f'data-copy-success="{_safe_attr(labels["copy_success"], maximum=80)}" '
|
|
722
|
+
f'data-copy-failed="{_safe_attr(labels["copy_failed"], maximum=80)}"></div>'
|
|
723
|
+
'<script type="application/json" data-report-markdown>'
|
|
724
|
+
f"{_embedded_json(markdown_artifact['content'])}</script>"
|
|
725
|
+
f"<script>{_SCRIPT}</script></body></html>\n"
|
|
726
|
+
)
|
|
727
|
+
content_digest = hashlib.sha256(content.encode("utf-8")).hexdigest()
|
|
728
|
+
return {
|
|
729
|
+
"schema_version": ARTIFACT_SCHEMA,
|
|
730
|
+
"artifact_id": "periodic_report_html",
|
|
731
|
+
"renderer_id": "html_artifact_v0",
|
|
732
|
+
"renderer_kind": "html",
|
|
733
|
+
"media_type": "text/html; charset=utf-8",
|
|
734
|
+
"content": content,
|
|
735
|
+
"content_digest": f"sha256:{content_digest}",
|
|
736
|
+
"artifact_ref": f"artifact:periodic-report/{content_digest[:24]}",
|
|
737
|
+
"document_digest": f"sha256:{document_digest}",
|
|
738
|
+
"companion_markdown_digest": markdown_artifact["content_digest"],
|
|
739
|
+
"single_file": True,
|
|
740
|
+
"zero_build": True,
|
|
741
|
+
"external_dependencies": [],
|
|
742
|
+
"interactive_controls": [
|
|
743
|
+
"section_filter",
|
|
744
|
+
"text_filter",
|
|
745
|
+
"copy_markdown",
|
|
746
|
+
"print_report",
|
|
747
|
+
],
|
|
748
|
+
"presentation_profile": "editorial_dense_v2",
|
|
749
|
+
"content_policy": {
|
|
750
|
+
"primary_body_fields": [
|
|
751
|
+
"title",
|
|
752
|
+
"status",
|
|
753
|
+
"tags",
|
|
754
|
+
"tag_labels",
|
|
755
|
+
"summary",
|
|
756
|
+
"details",
|
|
757
|
+
"next_action",
|
|
758
|
+
"source_ref",
|
|
759
|
+
],
|
|
760
|
+
"primary_visibility": "primary",
|
|
761
|
+
"supporting_visibility": "supporting",
|
|
762
|
+
"supporting_context": "collapsed",
|
|
763
|
+
"process_narration_default_visible": False,
|
|
764
|
+
"editorial_summary_source": editorial_orchestration.get(
|
|
765
|
+
"summary_source", "none"
|
|
766
|
+
),
|
|
767
|
+
"readability_policy": editorial_orchestration.get(
|
|
768
|
+
"readability_policy", "none"
|
|
769
|
+
),
|
|
770
|
+
"primary_item_count": item_count,
|
|
771
|
+
"supporting_item_count": supporting_item_count,
|
|
772
|
+
},
|
|
773
|
+
"boundary": {
|
|
774
|
+
"schedule_policy_applied": False,
|
|
775
|
+
"business_evidence_judged": False,
|
|
776
|
+
"external_writes_performed": False,
|
|
777
|
+
},
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
def periodic_report_html_renderer_adapter() -> PeriodicReportRendererAdapter:
|
|
782
|
+
return PeriodicReportRendererAdapter(
|
|
783
|
+
renderer_id="html_artifact_v0",
|
|
784
|
+
renderer_kind="html",
|
|
785
|
+
render=render_periodic_report_html,
|
|
786
|
+
)
|