phase-loop-runtime 0.2.0__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.
- phase_loop_runtime/__init__.py +20 -0
- phase_loop_runtime/_contract_docs/phase-loop/extraction-readiness.md +90 -0
- phase_loop_runtime/_contract_docs/phase-loop/granular-execution-policy.md +137 -0
- phase_loop_runtime/_contract_docs/phase-loop/harness-capability-matrix.md +510 -0
- phase_loop_runtime/_contract_docs/phase-loop/harness-skill-matrix.md +125 -0
- phase_loop_runtime/_contract_docs/phase-loop/harness-substrate-manifest.md +232 -0
- phase_loop_runtime/_contract_docs/phase-loop/pi-loop-control.md +247 -0
- phase_loop_runtime/_contract_docs/phase-loop/protocol.md +2759 -0
- phase_loop_runtime/_contract_docs/phase-loop/runtime-boundary.md +289 -0
- phase_loop_runtime/_contract_docs/phase-loop/spec-discovery-roots.md +47 -0
- phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-governed-pipeline.md +42 -0
- phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-portal-projection.md +34 -0
- phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-regenesis.md +29 -0
- phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-report.md +32 -0
- phase_loop_runtime/_contract_docs/runtime/verification-evidence-contract.md +52 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-mixed-signals/commands.txt +2 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-mixed-signals/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-mixed-signals/mixed.json +5 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-provider-timeout/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-provider-timeout/timeout-note.txt +2 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-redacted-summary/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-redacted-summary/redacted-summary.json +6 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-small-sample/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-small-sample/sample.json +7 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-threshold-edge/edge.txt +2 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-threshold-edge/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/shot-a.txt +1 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/shot-b.txt +1 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/shot-c.txt +1 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-missing-references/claimed-results.json +5 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-missing-references/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-subtle-low-variance/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-subtle-low-variance/metrics.json +9 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-templated-prose/findings.md +10 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-templated-prose/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-uniform-scores/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-uniform-scores/scores.json +4 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-uniform-scores/summary.txt +1 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-adoption-bundle/bundle-check.json +8 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-adoption-bundle/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-adoption-bundle/operator-note.txt +2 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-handoff-ledger/events-sample.jsonl +3 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-handoff-ledger/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-handoff-ledger/receipt.txt +1 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-runner-diff/evidence.json +13 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-runner-diff/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-runner-diff/summary.txt +2 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-test-matrix/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-test-matrix/matrix.json +9 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-test-matrix/notes.md +4 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-ui-screenshot-standin/console-summary.txt +2 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-ui-screenshot-standin/manifest.json +16 -0
- phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-ui-screenshot-standin/screenshot-standin.ppm +5 -0
- phase_loop_runtime/adoption_bundle.py +273 -0
- phase_loop_runtime/advisor_board/CONTRACTS.md +257 -0
- phase_loop_runtime/advisor_board/__init__.py +288 -0
- phase_loop_runtime/advisor_board/backing.py +137 -0
- phase_loop_runtime/advisor_board/backing_omnigent.py +498 -0
- phase_loop_runtime/advisor_board/config.py +225 -0
- phase_loop_runtime/advisor_board/events.py +115 -0
- phase_loop_runtime/advisor_board/fixtures/advisor-boards.example.toml +59 -0
- phase_loop_runtime/advisor_board/fixtures.py +91 -0
- phase_loop_runtime/advisor_board/harness_mapping.py +125 -0
- phase_loop_runtime/advisor_board/matrix.py +146 -0
- phase_loop_runtime/advisor_board/observability.py +481 -0
- phase_loop_runtime/advisor_board/presets.py +188 -0
- phase_loop_runtime/advisor_board/registries.py +309 -0
- phase_loop_runtime/advisor_board/resolver.py +253 -0
- phase_loop_runtime/advisor_board/schema.py +269 -0
- phase_loop_runtime/advisor_board/standin.py +166 -0
- phase_loop_runtime/advisor_board/validation.py +159 -0
- phase_loop_runtime/agent_runtime_provider.py +676 -0
- phase_loop_runtime/baml_modular.py +656 -0
- phase_loop_runtime/baml_src/dotfiles_adoption_manifest.baml +37 -0
- phase_loop_runtime/baml_src/dotfiles_c4_document.baml +14 -0
- phase_loop_runtime/baml_src/dotfiles_plan_manifest.baml +50 -0
- phase_loop_runtime/baml_src/dotfiles_runtime_projection.baml +16 -0
- phase_loop_runtime/baml_src/dotfiles_task_catalog.baml +20 -0
- phase_loop_runtime/baml_src/emit_phase_closeout.baml +86 -0
- phase_loop_runtime/baml_src/evaluate_suspected_fake_evidence.baml +36 -0
- phase_loop_runtime/baml_src/verification_evidence.baml +40 -0
- phase_loop_runtime/broker.py +181 -0
- phase_loop_runtime/build_bundle.py +294 -0
- phase_loop_runtime/capability_registry.py +835 -0
- phase_loop_runtime/classifier.py +87 -0
- phase_loop_runtime/claude_agent_view.py +625 -0
- phase_loop_runtime/claude_channel_sidecar.py +1086 -0
- phase_loop_runtime/cli.py +2599 -0
- phase_loop_runtime/closeout.py +865 -0
- phase_loop_runtime/closeout_classifier.py +120 -0
- phase_loop_runtime/closeout_evidence_audit.py +112 -0
- phase_loop_runtime/closeout_validation.py +144 -0
- phase_loop_runtime/closeout_validators.py +203 -0
- phase_loop_runtime/consiliency_gates.py +374 -0
- phase_loop_runtime/consiliency_ingest.py +399 -0
- phase_loop_runtime/consiliency_layout.py +176 -0
- phase_loop_runtime/consiliency_scaffold.py +305 -0
- phase_loop_runtime/cross_repo_channel.py +331 -0
- phase_loop_runtime/discovery.py +2368 -0
- phase_loop_runtime/dispatch_lock.py +167 -0
- phase_loop_runtime/doc_delta_validator.py +98 -0
- phase_loop_runtime/docs_audit.py +285 -0
- phase_loop_runtime/docs_freshness.py +468 -0
- phase_loop_runtime/docs_surfaces.py +150 -0
- phase_loop_runtime/dotfiles_profile_plugin.py +96 -0
- phase_loop_runtime/events.py +154 -0
- phase_loop_runtime/events_migration.py +96 -0
- phase_loop_runtime/evidence_audit.py +1082 -0
- phase_loop_runtime/evidence_audit_config.py +172 -0
- phase_loop_runtime/fleet_map.py +426 -0
- phase_loop_runtime/fleet_metrics.py +298 -0
- phase_loop_runtime/fleet_metrics_export.py +196 -0
- phase_loop_runtime/git_discipline.py +479 -0
- phase_loop_runtime/git_ops.py +122 -0
- phase_loop_runtime/git_topology.py +252 -0
- phase_loop_runtime/governed_bundle.py +137 -0
- phase_loop_runtime/governed_premerge.py +219 -0
- phase_loop_runtime/governed_review.py +264 -0
- phase_loop_runtime/handoff.py +932 -0
- phase_loop_runtime/handoff_path.py +14 -0
- phase_loop_runtime/injection.py +740 -0
- phase_loop_runtime/install_status.py +88 -0
- phase_loop_runtime/lane_scheduler.py +317 -0
- phase_loop_runtime/launcher.py +2760 -0
- phase_loop_runtime/lease_store.py +553 -0
- phase_loop_runtime/maintenance.py +401 -0
- phase_loop_runtime/migrate_handoffs.py +201 -0
- phase_loop_runtime/models.py +2144 -0
- phase_loop_runtime/observability.py +1290 -0
- phase_loop_runtime/panel_invoker.py +1638 -0
- phase_loop_runtime/phase_loop_drift_audit.py +388 -0
- phase_loop_runtime/phase_worktree_executor.py +433 -0
- phase_loop_runtime/pipeline_adapter/__init__.py +12 -0
- phase_loop_runtime/pipeline_adapter/branch_ops.py +274 -0
- phase_loop_runtime/pipeline_adapter/flag.py +55 -0
- phase_loop_runtime/pipeline_adapter/markers.py +13 -0
- phase_loop_runtime/pipeline_adapter/merge_policy.py +72 -0
- phase_loop_runtime/pipeline_adapter/ratification.py +100 -0
- phase_loop_runtime/pipeline_adapter/sibling_matcher.py +123 -0
- phase_loop_runtime/plan_ir.py +523 -0
- phase_loop_runtime/plan_manifest.py +415 -0
- phase_loop_runtime/planner_validation.py +176 -0
- phase_loop_runtime/profiles.py +462 -0
- phase_loop_runtime/prompts.py +365 -0
- phase_loop_runtime/provenance.py +165 -0
- phase_loop_runtime/publishing.py +339 -0
- phase_loop_runtime/py.typed +1 -0
- phase_loop_runtime/reconcile.py +1550 -0
- phase_loop_runtime/redaction.py +184 -0
- phase_loop_runtime/reflection_sync.py +293 -0
- phase_loop_runtime/release_guard.py +186 -0
- phase_loop_runtime/render.py +432 -0
- phase_loop_runtime/repo_validation.py +427 -0
- phase_loop_runtime/review_summary.py +150 -0
- phase_loop_runtime/roadmap_lint.py +425 -0
- phase_loop_runtime/route_log.py +59 -0
- phase_loop_runtime/route_policy/__init__.py +11 -0
- phase_loop_runtime/route_policy/fixtures/route_selection.golden.json +263 -0
- phase_loop_runtime/runner.py +8400 -0
- phase_loop_runtime/runtime_paths.py +225 -0
- phase_loop_runtime/runtime_projection.py +113 -0
- phase_loop_runtime/runtime_resources.py +36 -0
- phase_loop_runtime/schema_export.py +292 -0
- phase_loop_runtime/schemas/phase_loop_closeout.schema.json +366 -0
- phase_loop_runtime/skill_install.py +176 -0
- phase_loop_runtime/skill_inventory.py +662 -0
- phase_loop_runtime/skill_paths.py +42 -0
- phase_loop_runtime/skill_sources_plugin.py +37 -0
- phase_loop_runtime/skills_bundle/claude-advisor-board/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-advisor-board/SKILL.md +38 -0
- phase_loop_runtime/skills_bundle/claude-advisor-panel/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-advisor-panel/SKILL.md +38 -0
- phase_loop_runtime/skills_bundle/claude-execute-detailed/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-execute-detailed/SKILL.md +152 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/SKILL.md +745 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/allocate_worktree_name.sh +33 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/audit_lane_file_touches.py +197 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/state.py +274 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/team_teardown.sh +32 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/validate_plan_doc.py +642 -0
- phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/verify_harness.sh +96 -0
- phase_loop_runtime/skills_bundle/claude-phase-loop/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-phase-loop/SKILL.md +115 -0
- phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/SKILL.md +439 -0
- phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/assets/review_prompt.md +19 -0
- phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
- phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/references/roadmap-template.md +193 -0
- phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
- phase_loop_runtime/skills_bundle/claude-plan-detailed/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-plan-detailed/SKILL.md +334 -0
- phase_loop_runtime/skills_bundle/claude-plan-detailed/assets/review_prompt.md +25 -0
- phase_loop_runtime/skills_bundle/claude-plan-phase/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-plan-phase/SKILL.md +776 -0
- phase_loop_runtime/skills_bundle/claude-plan-phase/assets/review_prompt.md +17 -0
- phase_loop_runtime/skills_bundle/claude-plan-phase/scripts/validate_plan_doc.py +1092 -0
- phase_loop_runtime/skills_bundle/claude-run-train/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-run-train/SKILL.md +75 -0
- phase_loop_runtime/skills_bundle/claude-skill-editor/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-skill-editor/SKILL.md +243 -0
- phase_loop_runtime/skills_bundle/claude-skill-editor/assets/editor_prompt.md +72 -0
- phase_loop_runtime/skills_bundle/claude-skill-improvement-planner/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-skill-improvement-planner/SKILL.md +249 -0
- phase_loop_runtime/skills_bundle/claude-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
- phase_loop_runtime/skills_bundle/claude-task-contextualizer/README.md +1 -0
- phase_loop_runtime/skills_bundle/claude-task-contextualizer/SKILL.md +74 -0
- phase_loop_runtime/skills_bundle/claude-task-contextualizer/references/task-templates.md +103 -0
- phase_loop_runtime/skills_bundle/codex-advisor-board/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-advisor-board/SKILL.md +38 -0
- phase_loop_runtime/skills_bundle/codex-advisor-panel/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-advisor-panel/SKILL.md +38 -0
- phase_loop_runtime/skills_bundle/codex-execute-detailed/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-execute-detailed/SKILL.md +154 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/SKILL.md +231 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/allocate_worktree_name.sh +33 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/audit_lane_file_touches.py +197 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/state.py +274 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/team_teardown.sh +32 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/validate_plan_doc.py +642 -0
- phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/verify_harness.sh +96 -0
- phase_loop_runtime/skills_bundle/codex-phase-loop/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-phase-loop/SKILL.md +248 -0
- phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/SKILL.md +150 -0
- phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/assets/review_prompt.md +19 -0
- phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
- phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/references/roadmap-template.md +193 -0
- phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
- phase_loop_runtime/skills_bundle/codex-plan-detailed/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-plan-detailed/SKILL.md +119 -0
- phase_loop_runtime/skills_bundle/codex-plan-detailed/assets/review_prompt.md +25 -0
- phase_loop_runtime/skills_bundle/codex-plan-phase/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-plan-phase/SKILL.md +307 -0
- phase_loop_runtime/skills_bundle/codex-plan-phase/assets/review_prompt.md +17 -0
- phase_loop_runtime/skills_bundle/codex-plan-phase/scripts/validate_plan_doc.py +1092 -0
- phase_loop_runtime/skills_bundle/codex-run-train/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-run-train/SKILL.md +75 -0
- phase_loop_runtime/skills_bundle/codex-skill-editor/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-skill-editor/SKILL.md +94 -0
- phase_loop_runtime/skills_bundle/codex-skill-editor/assets/editor_prompt.md +72 -0
- phase_loop_runtime/skills_bundle/codex-skill-improvement-planner/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-skill-improvement-planner/SKILL.md +114 -0
- phase_loop_runtime/skills_bundle/codex-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
- phase_loop_runtime/skills_bundle/codex-task-contextualizer/README.md +1 -0
- phase_loop_runtime/skills_bundle/codex-task-contextualizer/SKILL.md +102 -0
- phase_loop_runtime/skills_bundle/codex-task-contextualizer/references/task-templates.md +103 -0
- phase_loop_runtime/skills_bundle/gemini-advisor-board/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-advisor-board/SKILL.md +38 -0
- phase_loop_runtime/skills_bundle/gemini-advisor-panel/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-advisor-panel/SKILL.md +38 -0
- phase_loop_runtime/skills_bundle/gemini-execute-detailed/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-execute-detailed/SKILL.md +144 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/SKILL.md +198 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/allocate_worktree_name.sh +33 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/audit_lane_file_touches.py +197 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/state.py +274 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/team_teardown.sh +32 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/validate_plan_doc.py +642 -0
- phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/verify_harness.sh +96 -0
- phase_loop_runtime/skills_bundle/gemini-phase-loop/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-phase-loop/SKILL.md +111 -0
- phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/SKILL.md +147 -0
- phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/assets/review_prompt.md +19 -0
- phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
- phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/references/roadmap-template.md +193 -0
- phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
- phase_loop_runtime/skills_bundle/gemini-plan-detailed/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-plan-detailed/SKILL.md +119 -0
- phase_loop_runtime/skills_bundle/gemini-plan-detailed/assets/review_prompt.md +25 -0
- phase_loop_runtime/skills_bundle/gemini-plan-phase/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-plan-phase/SKILL.md +217 -0
- phase_loop_runtime/skills_bundle/gemini-plan-phase/assets/review_prompt.md +17 -0
- phase_loop_runtime/skills_bundle/gemini-plan-phase/scripts/validate_plan_doc.py +1092 -0
- phase_loop_runtime/skills_bundle/gemini-run-train/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-run-train/SKILL.md +75 -0
- phase_loop_runtime/skills_bundle/gemini-skill-editor/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-skill-editor/SKILL.md +87 -0
- phase_loop_runtime/skills_bundle/gemini-skill-editor/assets/editor_prompt.md +72 -0
- phase_loop_runtime/skills_bundle/gemini-skill-improvement-planner/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-skill-improvement-planner/SKILL.md +109 -0
- phase_loop_runtime/skills_bundle/gemini-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
- phase_loop_runtime/skills_bundle/gemini-task-contextualizer/README.md +1 -0
- phase_loop_runtime/skills_bundle/gemini-task-contextualizer/SKILL.md +98 -0
- phase_loop_runtime/skills_bundle/gemini-task-contextualizer/references/task-templates.md +103 -0
- phase_loop_runtime/skills_bundle/opencode-advisor-board/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-advisor-board/SKILL.md +38 -0
- phase_loop_runtime/skills_bundle/opencode-advisor-panel/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-advisor-panel/SKILL.md +38 -0
- phase_loop_runtime/skills_bundle/opencode-execute-detailed/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-execute-detailed/SKILL.md +144 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/SKILL.md +196 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/allocate_worktree_name.sh +33 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/audit_lane_file_touches.py +197 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/state.py +274 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/team_teardown.sh +32 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/validate_plan_doc.py +642 -0
- phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/verify_harness.sh +96 -0
- phase_loop_runtime/skills_bundle/opencode-phase-loop/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-phase-loop/SKILL.md +113 -0
- phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/SKILL.md +147 -0
- phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/assets/review_prompt.md +19 -0
- phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
- phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/references/roadmap-template.md +193 -0
- phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
- phase_loop_runtime/skills_bundle/opencode-plan-detailed/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-plan-detailed/SKILL.md +119 -0
- phase_loop_runtime/skills_bundle/opencode-plan-detailed/assets/review_prompt.md +25 -0
- phase_loop_runtime/skills_bundle/opencode-plan-phase/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-plan-phase/SKILL.md +211 -0
- phase_loop_runtime/skills_bundle/opencode-plan-phase/assets/review_prompt.md +17 -0
- phase_loop_runtime/skills_bundle/opencode-plan-phase/scripts/validate_plan_doc.py +1092 -0
- phase_loop_runtime/skills_bundle/opencode-run-train/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-run-train/SKILL.md +75 -0
- phase_loop_runtime/skills_bundle/opencode-skill-editor/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-skill-editor/SKILL.md +87 -0
- phase_loop_runtime/skills_bundle/opencode-skill-editor/assets/editor_prompt.md +72 -0
- phase_loop_runtime/skills_bundle/opencode-skill-improvement-planner/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-skill-improvement-planner/SKILL.md +109 -0
- phase_loop_runtime/skills_bundle/opencode-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
- phase_loop_runtime/skills_bundle/opencode-task-contextualizer/README.md +1 -0
- phase_loop_runtime/skills_bundle/opencode-task-contextualizer/SKILL.md +98 -0
- phase_loop_runtime/skills_bundle/opencode-task-contextualizer/references/task-templates.md +103 -0
- phase_loop_runtime/state.py +156 -0
- phase_loop_runtime/state_degradation.py +136 -0
- phase_loop_runtime/state_ops.py +676 -0
- phase_loop_runtime/train_ledger.py +215 -0
- phase_loop_runtime/train_roadmap.py +339 -0
- phase_loop_runtime/train_runner.py +1197 -0
- phase_loop_runtime/verification_evidence.py +650 -0
- phase_loop_runtime/verification_evidence_validator.py +75 -0
- phase_loop_runtime/visual_evidence_validator.py +36 -0
- phase_loop_runtime/worker_pool.py +123 -0
- phase_loop_runtime/worktree_index.py +270 -0
- phase_loop_runtime-0.2.0.data/data/share/phase-loop-runtime/protocol/protocol.md +2475 -0
- phase_loop_runtime-0.2.0.dist-info/METADATA +106 -0
- phase_loop_runtime-0.2.0.dist-info/RECORD +370 -0
- phase_loop_runtime-0.2.0.dist-info/WHEEL +5 -0
- phase_loop_runtime-0.2.0.dist-info/entry_points.txt +9 -0
- phase_loop_runtime-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import re
|
|
5
|
+
import shutil
|
|
6
|
+
from dataclasses import asdict, dataclass, field
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Mapping, Sequence
|
|
9
|
+
|
|
10
|
+
from .skill_install import REQUIRED_SKILLS
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
ACTIVE_HARNESSES: tuple[str, ...] = ("claude", "codex", "gemini", "opencode")
|
|
14
|
+
|
|
15
|
+
# Harness-agnostic auxiliary subdirectories carried verbatim into the neutral
|
|
16
|
+
# bundle so that `install` (which copytrees the whole skill dir) propagates them
|
|
17
|
+
# to every harness root. Without this, the SKILL Step 8 helper
|
|
18
|
+
# `scripts/validate_roadmap.py` never leaves the canonical source tree.
|
|
19
|
+
AUX_SUBDIRS: tuple[str, ...] = ("scripts", "references", "assets")
|
|
20
|
+
# IF-0-CANON-1: the canonical phase-loop skill sources now live IN this repo
|
|
21
|
+
# under `skills-src/<harness>/` (one tree per active harness, each holding
|
|
22
|
+
# `<harness>-<skill>/` dirs). `build_bundle` consumes these to produce the
|
|
23
|
+
# committed `phase-loop-skills/` bundle with NO dotfiles checkout required.
|
|
24
|
+
# The fleet's `bootstrap.sh` may still override these with an explicit
|
|
25
|
+
# `--source <dotfiles-root>` during the cutover; that path keeps working.
|
|
26
|
+
DEFAULT_SOURCES: dict[str, str] = {
|
|
27
|
+
"claude": "skills-src/claude",
|
|
28
|
+
"codex": "skills-src/codex",
|
|
29
|
+
"gemini": "skills-src/gemini",
|
|
30
|
+
"opencode": "skills-src/opencode",
|
|
31
|
+
}
|
|
32
|
+
OVERRIDE_README = "Harness-specific overlay files for this workflow skill.\n"
|
|
33
|
+
|
|
34
|
+
# Concrete, harness-SPECIFIC literals that must survive neutralization verbatim.
|
|
35
|
+
# `_neutralize_skill` collapses every `<harness>-`/`<harness> `/`<harness>_`/
|
|
36
|
+
# `<harness>.`/`Harness` token so the shared base + per-harness overrides read
|
|
37
|
+
# the same across harnesses. That is correct for harness-VARIANT tokens (skill
|
|
38
|
+
# names like `claude-execute-phase`, config dirs like `claude-config`, install
|
|
39
|
+
# paths) — they genuinely change per harness. It is WRONG for concrete Claude
|
|
40
|
+
# identifiers that name one real thing and have no per-harness variant: an Opus
|
|
41
|
+
# model id is `claude-opus-4-8` for every harness, and `<harness>-in-chrome`
|
|
42
|
+
# denotes nothing (the tool is `claude-in-chrome`; no `codex-in-chrome` exists).
|
|
43
|
+
# Membership test: "if this skill installed for codex, would the token need to
|
|
44
|
+
# become `codex-X`?" Yes -> collapse (NOT here). No, it's Claude-specific by
|
|
45
|
+
# nature -> preserve (here). These are masked to a sentinel before the collapse
|
|
46
|
+
# regexes run and restored after, so the literal ships intact into the installed
|
|
47
|
+
# bundle. (Applied uniformly to base + override; model ids never appear in the
|
|
48
|
+
# codex base, so masking is a no-op there and the dedup comparison is unaffected.)
|
|
49
|
+
PRESERVE_LITERALS: tuple[str, ...] = (
|
|
50
|
+
"claude-opus-4-8",
|
|
51
|
+
"claude-sonnet-5",
|
|
52
|
+
"claude-haiku-4-5",
|
|
53
|
+
"claude-in-chrome",
|
|
54
|
+
# Display-name model form as it appears in the `Co-Authored-By:` git trailer.
|
|
55
|
+
# Without this the brand collapse (`Claude` -> `Harness`) rewrites the trailer
|
|
56
|
+
# to `Harness Opus 4.8` — a concrete model attribution corrupted into a name
|
|
57
|
+
# that denotes nothing. One real model, no per-harness variant -> preserve.
|
|
58
|
+
"Claude Opus 4.8",
|
|
59
|
+
)
|
|
60
|
+
_PRESERVE_SENTINEL = "\x00PRESERVE{index}\x00"
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@dataclass(frozen=True)
|
|
64
|
+
class BuildWarning:
|
|
65
|
+
skill: str
|
|
66
|
+
message: str
|
|
67
|
+
harness: str | None = None
|
|
68
|
+
path: str | None = None
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@dataclass(frozen=True)
|
|
72
|
+
class SkippedSkill:
|
|
73
|
+
skill: str
|
|
74
|
+
missing_harnesses: tuple[str, ...]
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@dataclass(frozen=True)
|
|
78
|
+
class BuildResult:
|
|
79
|
+
skills_regenerated: list[str] = field(default_factory=list)
|
|
80
|
+
overrides_written: list[str] = field(default_factory=list)
|
|
81
|
+
skills_skipped: list[SkippedSkill] = field(default_factory=list)
|
|
82
|
+
warnings: list[BuildWarning] = field(default_factory=list)
|
|
83
|
+
files_written: list[str] = field(default_factory=list)
|
|
84
|
+
dry_run: bool = False
|
|
85
|
+
applied: bool = False
|
|
86
|
+
|
|
87
|
+
def to_dict(self) -> dict[str, object]:
|
|
88
|
+
return {
|
|
89
|
+
"skills_regenerated": self.skills_regenerated,
|
|
90
|
+
"overrides_written": self.overrides_written,
|
|
91
|
+
"skills_skipped": [asdict(skill) for skill in self.skills_skipped],
|
|
92
|
+
"warnings": [asdict(warning) for warning in self.warnings],
|
|
93
|
+
"files_written": self.files_written,
|
|
94
|
+
"dry_run": self.dry_run,
|
|
95
|
+
"applied": self.applied,
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
def to_json(self) -> str:
|
|
99
|
+
return json.dumps(self.to_dict(), indent=2, sort_keys=True)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def build_bundle(
|
|
103
|
+
sources: Sequence[Path | str] | Mapping[str, Path | str] | None,
|
|
104
|
+
destination: Path | str,
|
|
105
|
+
*,
|
|
106
|
+
dry_run: bool,
|
|
107
|
+
apply: bool,
|
|
108
|
+
force: bool = False,
|
|
109
|
+
) -> BuildResult:
|
|
110
|
+
source_roots = _normalize_sources(sources)
|
|
111
|
+
destination_root = Path(destination)
|
|
112
|
+
effective_apply = bool(apply and not dry_run)
|
|
113
|
+
|
|
114
|
+
skills_regenerated: list[str] = []
|
|
115
|
+
overrides_written: list[str] = []
|
|
116
|
+
skills_skipped: list[SkippedSkill] = []
|
|
117
|
+
warnings: list[BuildWarning] = []
|
|
118
|
+
files_written: list[str] = []
|
|
119
|
+
|
|
120
|
+
for skill in REQUIRED_SKILLS:
|
|
121
|
+
canonical_paths = {
|
|
122
|
+
harness: root / f"{harness}-{skill}" / "SKILL.md"
|
|
123
|
+
for harness, root in source_roots.items()
|
|
124
|
+
}
|
|
125
|
+
missing = tuple(
|
|
126
|
+
harness for harness in ACTIVE_HARNESSES if not canonical_paths[harness].is_file()
|
|
127
|
+
)
|
|
128
|
+
if missing:
|
|
129
|
+
skills_skipped.append(SkippedSkill(skill=skill, missing_harnesses=missing))
|
|
130
|
+
warnings.append(
|
|
131
|
+
BuildWarning(
|
|
132
|
+
skill=skill,
|
|
133
|
+
message=f"missing canonical SKILL.md for {', '.join(missing)}",
|
|
134
|
+
)
|
|
135
|
+
)
|
|
136
|
+
continue
|
|
137
|
+
|
|
138
|
+
neutral_base = _neutralize_skill(
|
|
139
|
+
canonical_paths["codex"].read_text(encoding="utf-8"),
|
|
140
|
+
harness="codex",
|
|
141
|
+
skill=skill,
|
|
142
|
+
)
|
|
143
|
+
skill_dir = destination_root / skill
|
|
144
|
+
base_path = skill_dir / "SKILL.md"
|
|
145
|
+
if _record_write(base_path, neutral_base, dry_run=dry_run, apply=effective_apply, force=force):
|
|
146
|
+
skills_regenerated.append(skill)
|
|
147
|
+
files_written.append(base_path.as_posix())
|
|
148
|
+
|
|
149
|
+
# Carry harness-agnostic auxiliary subdirs (scripts/, references/,
|
|
150
|
+
# assets/) into the neutral bundle. Source from the first harness whose
|
|
151
|
+
# canonical dir provides each subdir (ACTIVE_HARNESSES order), since the
|
|
152
|
+
# content is shared, not harness-specific.
|
|
153
|
+
for aux in AUX_SUBDIRS:
|
|
154
|
+
source_aux = next(
|
|
155
|
+
(
|
|
156
|
+
canonical_paths[harness].parent / aux
|
|
157
|
+
for harness in ACTIVE_HARNESSES
|
|
158
|
+
if (canonical_paths[harness].parent / aux).is_dir()
|
|
159
|
+
),
|
|
160
|
+
None,
|
|
161
|
+
)
|
|
162
|
+
if source_aux is None:
|
|
163
|
+
continue
|
|
164
|
+
for src_file in sorted(source_aux.rglob("*")):
|
|
165
|
+
if not src_file.is_file():
|
|
166
|
+
continue
|
|
167
|
+
if "__pycache__" in src_file.parts or src_file.suffix == ".pyc":
|
|
168
|
+
continue
|
|
169
|
+
target = skill_dir / aux / src_file.relative_to(source_aux)
|
|
170
|
+
files_written.append(target.as_posix())
|
|
171
|
+
if effective_apply:
|
|
172
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
173
|
+
shutil.copy2(src_file, target)
|
|
174
|
+
|
|
175
|
+
for harness in ACTIVE_HARNESSES:
|
|
176
|
+
readme_path = skill_dir / "_overrides" / harness / "README.md"
|
|
177
|
+
if _record_write(readme_path, OVERRIDE_README, dry_run=dry_run, apply=effective_apply, force=force):
|
|
178
|
+
files_written.append(readme_path.as_posix())
|
|
179
|
+
|
|
180
|
+
for harness in ACTIVE_HARNESSES:
|
|
181
|
+
if harness == "codex":
|
|
182
|
+
override_text = None
|
|
183
|
+
else:
|
|
184
|
+
candidate = _neutralize_skill(
|
|
185
|
+
canonical_paths[harness].read_text(encoding="utf-8"),
|
|
186
|
+
harness=harness,
|
|
187
|
+
skill=skill,
|
|
188
|
+
)
|
|
189
|
+
override_text = candidate if candidate != neutral_base else None
|
|
190
|
+
override_path = skill_dir / "_overrides" / harness / "SKILL.md"
|
|
191
|
+
if override_text is None:
|
|
192
|
+
if override_path.exists() and (dry_run or effective_apply):
|
|
193
|
+
overrides_written.append(override_path.as_posix())
|
|
194
|
+
files_written.append(override_path.as_posix())
|
|
195
|
+
if effective_apply:
|
|
196
|
+
override_path.unlink()
|
|
197
|
+
continue
|
|
198
|
+
if _record_write(override_path, override_text, dry_run=dry_run, apply=effective_apply, force=force):
|
|
199
|
+
overrides_written.append(override_path.as_posix())
|
|
200
|
+
files_written.append(override_path.as_posix())
|
|
201
|
+
|
|
202
|
+
return BuildResult(
|
|
203
|
+
skills_regenerated=skills_regenerated,
|
|
204
|
+
overrides_written=overrides_written,
|
|
205
|
+
skills_skipped=skills_skipped,
|
|
206
|
+
warnings=warnings,
|
|
207
|
+
files_written=files_written,
|
|
208
|
+
dry_run=bool(dry_run),
|
|
209
|
+
applied=effective_apply,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def _normalize_sources(
|
|
214
|
+
sources: Sequence[Path | str] | Mapping[str, Path | str] | None,
|
|
215
|
+
) -> dict[str, Path]:
|
|
216
|
+
if sources is None:
|
|
217
|
+
return {harness: Path(path) for harness, path in DEFAULT_SOURCES.items()}
|
|
218
|
+
if isinstance(sources, Mapping):
|
|
219
|
+
roots = {str(harness): Path(path) for harness, path in sources.items()}
|
|
220
|
+
else:
|
|
221
|
+
roots = {}
|
|
222
|
+
for raw in sources:
|
|
223
|
+
path = Path(raw)
|
|
224
|
+
harness = _infer_harness(path)
|
|
225
|
+
if harness in roots:
|
|
226
|
+
raise ValueError(f"duplicate source root for {harness}: {path}")
|
|
227
|
+
roots[harness] = path
|
|
228
|
+
missing = [harness for harness in ACTIVE_HARNESSES if harness not in roots]
|
|
229
|
+
if missing:
|
|
230
|
+
raise ValueError(f"missing source root for {', '.join(missing)}")
|
|
231
|
+
unknown = [harness for harness in roots if harness not in ACTIVE_HARNESSES]
|
|
232
|
+
if unknown:
|
|
233
|
+
raise ValueError(f"unknown source harness {', '.join(sorted(unknown))}")
|
|
234
|
+
return {harness: roots[harness] for harness in ACTIVE_HARNESSES}
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def _infer_harness(path: Path) -> str:
|
|
238
|
+
text = path.as_posix()
|
|
239
|
+
for harness in ACTIVE_HARNESSES:
|
|
240
|
+
if re.search(rf"(^|[-_/]){re.escape(harness)}($|[-_/])", text):
|
|
241
|
+
return harness
|
|
242
|
+
raise ValueError(f"cannot infer harness from source root: {path}")
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
def _neutralize_skill(text: str, *, harness: str, skill: str) -> str:
|
|
246
|
+
output = text
|
|
247
|
+
# Mask concrete harness-specific literals so the collapse regexes below cannot
|
|
248
|
+
# corrupt them (e.g. `claude-opus-4-8` -> `<harness>-opus-4-8`). Restored verbatim
|
|
249
|
+
# at the end. See PRESERVE_LITERALS.
|
|
250
|
+
for index, literal in enumerate(PRESERVE_LITERALS):
|
|
251
|
+
output = output.replace(literal, _PRESERVE_SENTINEL.format(index=index))
|
|
252
|
+
output = re.sub(
|
|
253
|
+
rf"(?m)^name:\s+{re.escape(harness)}-{re.escape(skill)}\s*$",
|
|
254
|
+
f"name: {skill}",
|
|
255
|
+
output,
|
|
256
|
+
count=1,
|
|
257
|
+
)
|
|
258
|
+
output = re.sub(rf"\b{re.escape(harness)}-", "<harness>-", output)
|
|
259
|
+
output = re.sub(rf"\b{re.escape(harness)} ", "<harness> ", output)
|
|
260
|
+
output = re.sub(rf"\b{re.escape(harness)}_", "<harness>_", output)
|
|
261
|
+
output = re.sub(rf"\b{re.escape(harness)}\.", "<harness>.", output)
|
|
262
|
+
title = harness.capitalize()
|
|
263
|
+
output = re.sub(rf"\b{re.escape(title)}\b", "Harness", output)
|
|
264
|
+
output = output.replace(
|
|
265
|
+
"Executes one detailed plan artifact produced by `<harness>-plan-detailed`. Use this\n"
|
|
266
|
+
"when one Harness thread should implement a bounded plan end to end without phase\n"
|
|
267
|
+
"lanes or cross-harness dispatch.",
|
|
268
|
+
"Executes one detailed plan artifact produced by `<harness>-plan-detailed`. Use\n"
|
|
269
|
+
"this when one Harness thread should implement a bounded plan end to end without\n"
|
|
270
|
+
"phase lanes or cross-harness dispatch.",
|
|
271
|
+
)
|
|
272
|
+
output = output.replace(
|
|
273
|
+
"- Optionally read `.dev-skills/handoffs/<harness>-plan-detailed/latest.md` when no\n"
|
|
274
|
+
" explicit plan path is supplied, and only trust it if `from:` is",
|
|
275
|
+
"- Optionally read `.dev-skills/handoffs/<harness>-plan-detailed/latest.md`\n"
|
|
276
|
+
" when no explicit plan path is supplied, and only trust it if `from:` is",
|
|
277
|
+
)
|
|
278
|
+
# Restore the masked harness-specific literals verbatim.
|
|
279
|
+
for index, literal in enumerate(PRESERVE_LITERALS):
|
|
280
|
+
output = output.replace(_PRESERVE_SENTINEL.format(index=index), literal)
|
|
281
|
+
return output
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def _record_write(path: Path, content: str, *, dry_run: bool, apply: bool, force: bool) -> bool:
|
|
285
|
+
current = path.read_text(encoding="utf-8") if path.is_file() else None
|
|
286
|
+
changed = current != content
|
|
287
|
+
should_write = changed or (force and apply)
|
|
288
|
+
if dry_run:
|
|
289
|
+
return changed or force
|
|
290
|
+
if not apply or not should_write:
|
|
291
|
+
return False
|
|
292
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
293
|
+
path.write_text(content, encoding="utf-8")
|
|
294
|
+
return True
|