@opengsd/gsd-path 1.0.0 → 1.1.0
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.
- package/AGENTS.md +28 -11
- package/DOCS.md +6 -5
- package/FULL.md +9 -13
- package/QUICK.md +3 -3
- package/README.md +151 -14
- package/RUNTIME.md +7 -1
- package/WORKFLOW.md +30 -14
- package/package.json +15 -1
- package/platforms/shared-agents/dispatch.md +6 -0
- package/scripts/archive_milestone.py +10 -118
- package/scripts/bootstrap_repository.py +25 -3
- package/scripts/build_recovery.py +287 -0
- package/scripts/check_docs_audit.py +5 -3
- package/scripts/check_handoffs.py +1 -1
- package/scripts/detect_project.py +11 -2
- package/scripts/dispatch_driver.py +4 -2
- package/scripts/git_guard.py +2 -1
- package/scripts/install.mjs +2 -0
- package/scripts/install.py +2 -0
- package/scripts/integration.py +28 -22
- package/scripts/isolation.py +9 -1
- package/scripts/lean_verification.py +1 -1
- package/scripts/pipeline_diagnose.py +12 -3
- package/scripts/pipeline_state.py +114 -186
- package/scripts/pipeline_undo.py +11 -7
- package/scripts/promote_lookahead.py +30 -162
- package/scripts/roadmap.py +321 -0
- package/scripts/skill-resources.json +79 -1
- package/scripts/state_checkpoint.py +109 -72
- package/scripts/state_promote.py +42 -44
- package/scripts/task_context.py +73 -0
- package/scripts/token_budget.py +40 -1
- package/scripts/workflow_run.py +116 -7
- package/skills/gsd-path/BUILD.md +47 -575
- package/skills/gsd-path/DECIDE.md +2 -6
- package/skills/gsd-path/DEFINE.md +10 -14
- package/skills/gsd-path/INSPECT.md +30 -8
- package/skills/gsd-path/PLAN.md +25 -17
- package/skills/gsd-path/RESEARCH.md +3 -6
- package/skills/gsd-path/ROADMAP.md +22 -58
- package/skills/gsd-path/SHIP.md +5 -4
- package/skills/gsd-path/SKILL.md +24 -14
- package/skills/gsd-path/references/build-abandon.md +33 -0
- package/skills/gsd-path/references/build-native.md +494 -0
- package/skills/gsd-path/references/build-recovery.md +78 -0
- package/skills/gsd-path/references/coder.md +8 -3
- package/skills/gsd-path/references/dispatch.md +6 -0
- package/skills/gsd-path/references/docs-auditor.md +14 -0
- package/skills/gsd-path/references/reviewer-final.md +21 -0
- package/skills/gsd-path/references/reviewer-panel.md +17 -0
- package/skills/gsd-path/references/reviewer-skeptic.md +20 -0
- package/skills/gsd-path/references/reviewer-wave.md +89 -0
- package/skills/gsd-path/references/reviewer.md +12 -150
- package/skills/gsd-path/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/build_recovery.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/build_state.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/check_handoffs.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/check_task_briefs.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/discussion_records.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/integration.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/loop_run.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/review_findings.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/task_context.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/__pycache__/workflow_run.cpython-312.pyc +0 -0
- package/skills/gsd-path/scripts/archive_milestone.py +10 -118
- package/skills/gsd-path/scripts/bootstrap_repository.py +25 -3
- package/skills/gsd-path/scripts/build_recovery.py +287 -0
- package/skills/gsd-path/scripts/check_docs_audit.py +5 -3
- package/skills/gsd-path/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path/scripts/detect_project.py +11 -2
- package/skills/gsd-path/scripts/dispatch_driver.py +4 -2
- package/skills/gsd-path/scripts/integration.py +28 -22
- package/skills/gsd-path/scripts/isolation.py +9 -1
- package/skills/gsd-path/scripts/lean_verification.py +1 -1
- package/skills/gsd-path/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path/scripts/promote_lookahead.py +30 -162
- package/skills/gsd-path/scripts/roadmap.py +321 -0
- package/skills/gsd-path/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path/scripts/state_promote.py +42 -44
- package/skills/gsd-path/scripts/task_context.py +73 -0
- package/skills/gsd-path/scripts/token_budget.py +40 -1
- package/skills/gsd-path/scripts/workflow_run.py +116 -7
- package/skills/gsd-path/templates/wave-review.md +1 -1
- package/skills/gsd-path-build/SKILL.md +47 -575
- package/skills/gsd-path-build/references/build-abandon.md +33 -0
- package/skills/gsd-path-build/references/build-native.md +494 -0
- package/skills/gsd-path-build/references/build-recovery.md +78 -0
- package/skills/gsd-path-build/references/coder.md +8 -3
- package/skills/gsd-path-build/references/dispatch.md +6 -0
- package/skills/gsd-path-build/references/reviewer-final.md +21 -0
- package/skills/gsd-path-build/references/reviewer-panel.md +17 -0
- package/skills/gsd-path-build/references/reviewer-skeptic.md +20 -0
- package/skills/gsd-path-build/references/reviewer-wave.md +89 -0
- package/skills/gsd-path-build/references/reviewer.md +12 -150
- package/skills/gsd-path-build/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/build_recovery.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/build_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/check_handoffs.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/check_task_briefs.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/loop_run.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/review_findings.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/task_context.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/__pycache__/workflow_run.cpython-312.pyc +0 -0
- package/skills/gsd-path-build/scripts/archive_milestone.py +10 -118
- package/skills/gsd-path-build/scripts/build_recovery.py +287 -0
- package/skills/gsd-path-build/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path-build/scripts/detect_project.py +1526 -0
- package/skills/gsd-path-build/scripts/dispatch_driver.py +4 -2
- package/skills/gsd-path-build/scripts/integration.py +28 -22
- package/skills/gsd-path-build/scripts/isolation.py +9 -1
- package/skills/gsd-path-build/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path-build/scripts/promote_lookahead.py +283 -0
- package/skills/gsd-path-build/scripts/roadmap.py +321 -0
- package/skills/gsd-path-build/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path-build/scripts/state_promote.py +42 -44
- package/skills/gsd-path-build/scripts/task_context.py +73 -0
- package/skills/gsd-path-build/scripts/token_budget.py +40 -1
- package/skills/gsd-path-build/scripts/workflow_run.py +116 -7
- package/skills/gsd-path-build/templates/wave-review.md +1 -1
- package/skills/gsd-path-decide/SKILL.md +2 -6
- package/skills/gsd-path-decide/references/dispatch.md +6 -0
- package/skills/gsd-path-decide/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path-decide/scripts/archive_milestone.py +2157 -0
- package/skills/gsd-path-decide/scripts/build_recovery.py +287 -0
- package/skills/gsd-path-decide/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path-decide/scripts/detect_project.py +1526 -0
- package/skills/gsd-path-decide/scripts/discussion_validate.py +1321 -0
- package/skills/gsd-path-decide/scripts/integration.py +1439 -0
- package/skills/gsd-path-decide/scripts/isolation.py +9 -1
- package/skills/gsd-path-decide/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path-decide/scripts/promote_lookahead.py +283 -0
- package/skills/gsd-path-decide/scripts/review_panel.py +553 -0
- package/skills/gsd-path-decide/scripts/roadmap.py +321 -0
- package/skills/gsd-path-decide/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path-decide/scripts/state_promote.py +42 -44
- package/skills/gsd-path-define/SKILL.md +10 -14
- package/skills/gsd-path-define/references/build-recovery.md +78 -0
- package/skills/gsd-path-define/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path-define/scripts/archive_milestone.py +2157 -0
- package/skills/gsd-path-define/scripts/build_recovery.py +287 -0
- package/skills/gsd-path-define/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path-define/scripts/detect_project.py +11 -2
- package/skills/gsd-path-define/scripts/discussion_validate.py +1321 -0
- package/skills/gsd-path-define/scripts/integration.py +1439 -0
- package/skills/gsd-path-define/scripts/isolation.py +9 -1
- package/skills/gsd-path-define/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path-define/scripts/promote_lookahead.py +283 -0
- package/skills/gsd-path-define/scripts/review_panel.py +553 -0
- package/skills/gsd-path-define/scripts/roadmap.py +321 -0
- package/skills/gsd-path-define/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path-define/scripts/state_promote.py +42 -44
- package/skills/gsd-path-docs-audit/references/dispatch.md +6 -0
- package/skills/gsd-path-docs-audit/references/docs-auditor.md +14 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/build_recovery.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path-docs-audit/scripts/archive_milestone.py +2157 -0
- package/skills/gsd-path-docs-audit/scripts/build_recovery.py +287 -0
- package/skills/gsd-path-docs-audit/scripts/check_docs_audit.py +5 -3
- package/skills/gsd-path-docs-audit/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path-docs-audit/scripts/detect_project.py +1526 -0
- package/skills/gsd-path-docs-audit/scripts/discussion_validate.py +1321 -0
- package/skills/gsd-path-docs-audit/scripts/integration.py +1439 -0
- package/skills/gsd-path-docs-audit/scripts/isolation.py +9 -1
- package/skills/gsd-path-docs-audit/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path-docs-audit/scripts/promote_lookahead.py +283 -0
- package/skills/gsd-path-docs-audit/scripts/review_panel.py +553 -0
- package/skills/gsd-path-docs-audit/scripts/roadmap.py +321 -0
- package/skills/gsd-path-docs-audit/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path-docs-audit/scripts/state_promote.py +42 -44
- package/skills/gsd-path-forensics/scripts/__pycache__/pipeline_undo.cpython-312.pyc +0 -0
- package/skills/gsd-path-forensics/scripts/pipeline_diagnose.py +12 -3
- package/skills/gsd-path-forensics/scripts/pipeline_undo.py +11 -7
- package/skills/gsd-path-inspect/SKILL.md +30 -8
- package/skills/gsd-path-inspect/references/dispatch.md +6 -0
- package/skills/gsd-path-inspect/references/docs-auditor.md +14 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/build_recovery.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path-inspect/scripts/archive_milestone.py +2157 -0
- package/skills/gsd-path-inspect/scripts/build_recovery.py +287 -0
- package/skills/gsd-path-inspect/scripts/check_docs_audit.py +5 -3
- package/skills/gsd-path-inspect/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path-inspect/scripts/detect_project.py +11 -2
- package/skills/gsd-path-inspect/scripts/discussion_validate.py +1321 -0
- package/skills/gsd-path-inspect/scripts/integration.py +1439 -0
- package/skills/gsd-path-inspect/scripts/isolation.py +9 -1
- package/skills/gsd-path-inspect/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path-inspect/scripts/promote_lookahead.py +283 -0
- package/skills/gsd-path-inspect/scripts/review_panel.py +553 -0
- package/skills/gsd-path-inspect/scripts/roadmap.py +321 -0
- package/skills/gsd-path-inspect/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path-inspect/scripts/state_promote.py +42 -44
- package/skills/gsd-path-inspect/scripts/workflow_run.py +226 -0
- package/skills/gsd-path-plan/SKILL.md +25 -17
- package/skills/gsd-path-plan/references/build-recovery.md +78 -0
- package/skills/gsd-path-plan/references/dispatch.md +6 -0
- package/skills/gsd-path-plan/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path-plan/scripts/archive_milestone.py +2157 -0
- package/skills/gsd-path-plan/scripts/build_recovery.py +287 -0
- package/skills/gsd-path-plan/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path-plan/scripts/detect_project.py +1526 -0
- package/skills/gsd-path-plan/scripts/discussion_validate.py +1321 -0
- package/skills/gsd-path-plan/scripts/integration.py +1439 -0
- package/skills/gsd-path-plan/scripts/isolation.py +9 -1
- package/skills/gsd-path-plan/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path-plan/scripts/promote_lookahead.py +283 -0
- package/skills/gsd-path-plan/scripts/roadmap.py +321 -0
- package/skills/gsd-path-plan/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path-plan/scripts/state_promote.py +42 -44
- package/skills/gsd-path-plan/scripts/workflow_run.py +116 -7
- package/skills/gsd-path-research/SKILL.md +3 -6
- package/skills/gsd-path-research/references/dispatch.md +6 -0
- package/skills/gsd-path-research/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path-research/scripts/archive_milestone.py +2157 -0
- package/skills/gsd-path-research/scripts/build_recovery.py +287 -0
- package/skills/gsd-path-research/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path-research/scripts/detect_project.py +1526 -0
- package/skills/gsd-path-research/scripts/discussion_validate.py +1321 -0
- package/skills/gsd-path-research/scripts/integration.py +1439 -0
- package/skills/gsd-path-research/scripts/isolation.py +9 -1
- package/skills/gsd-path-research/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path-research/scripts/promote_lookahead.py +283 -0
- package/skills/gsd-path-research/scripts/review_panel.py +553 -0
- package/skills/gsd-path-research/scripts/roadmap.py +321 -0
- package/skills/gsd-path-research/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path-research/scripts/state_promote.py +42 -44
- package/skills/gsd-path-roadmap/SKILL.md +22 -58
- package/skills/gsd-path-roadmap/references/dispatch.md +6 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path-roadmap/scripts/archive_milestone.py +10 -118
- package/skills/gsd-path-roadmap/scripts/build_recovery.py +287 -0
- package/skills/gsd-path-roadmap/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path-roadmap/scripts/detect_project.py +11 -2
- package/skills/gsd-path-roadmap/scripts/integration.py +28 -22
- package/skills/gsd-path-roadmap/scripts/isolation.py +9 -1
- package/skills/gsd-path-roadmap/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path-roadmap/scripts/promote_lookahead.py +30 -162
- package/skills/gsd-path-roadmap/scripts/roadmap.py +321 -0
- package/skills/gsd-path-roadmap/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path-roadmap/scripts/state_promote.py +42 -44
- package/skills/gsd-path-ship/SKILL.md +5 -4
- package/skills/gsd-path-ship/references/dispatch.md +6 -0
- package/skills/gsd-path-ship/references/reviewer-final.md +21 -0
- package/skills/gsd-path-ship/references/reviewer-panel.md +17 -0
- package/skills/gsd-path-ship/references/reviewer-skeptic.md +20 -0
- package/skills/gsd-path-ship/references/reviewer-wave.md +89 -0
- package/skills/gsd-path-ship/references/reviewer.md +12 -150
- package/skills/gsd-path-ship/scripts/__pycache__/_common.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/archive_milestone.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/build_recovery.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/build_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/check_handoffs.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/check_task_briefs.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/detect_project.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/discussion_validate.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/isolation.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/pipeline_git.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/pipeline_state.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/review_panel.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/roadmap.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/__pycache__/state_checkpoint.cpython-312.pyc +0 -0
- package/skills/gsd-path-ship/scripts/archive_milestone.py +10 -118
- package/skills/gsd-path-ship/scripts/build_recovery.py +287 -0
- package/skills/gsd-path-ship/scripts/check_handoffs.py +1 -1
- package/skills/gsd-path-ship/scripts/detect_project.py +1526 -0
- package/skills/gsd-path-ship/scripts/integration.py +28 -22
- package/skills/gsd-path-ship/scripts/isolation.py +9 -1
- package/skills/gsd-path-ship/scripts/lean_verification.py +1 -1
- package/skills/gsd-path-ship/scripts/pipeline_state.py +114 -186
- package/skills/gsd-path-ship/scripts/promote_lookahead.py +283 -0
- package/skills/gsd-path-ship/scripts/roadmap.py +321 -0
- package/skills/gsd-path-ship/scripts/state_checkpoint.py +109 -72
- package/skills/gsd-path-ship/scripts/state_promote.py +42 -44
- package/skills/gsd-path-ship/scripts/workflow_run.py +116 -7
- package/skills/gsd-path-ship/templates/wave-review.md +1 -1
- package/skills/gsd-path-undo/scripts/pipeline_undo.py +11 -7
- package/skills/path/BUILD.md +47 -575
- package/skills/path/DECIDE.md +2 -6
- package/skills/path/DEFINE.md +10 -14
- package/skills/path/INSPECT.md +30 -8
- package/skills/path/PLAN.md +25 -17
- package/skills/path/RESEARCH.md +3 -6
- package/skills/path/ROADMAP.md +22 -58
- package/skills/path/SHIP.md +5 -4
- package/skills/path/SKILL.md +24 -14
- package/skills/path/references/build-abandon.md +33 -0
- package/skills/path/references/build-native.md +494 -0
- package/skills/path/references/build-recovery.md +78 -0
- package/skills/path/references/coder.md +8 -3
- package/skills/path/references/dispatch.md +6 -0
- package/skills/path/references/docs-auditor.md +14 -0
- package/skills/path/references/reviewer-final.md +21 -0
- package/skills/path/references/reviewer-panel.md +17 -0
- package/skills/path/references/reviewer-skeptic.md +20 -0
- package/skills/path/references/reviewer-wave.md +89 -0
- package/skills/path/references/reviewer.md +12 -150
- package/skills/path/scripts/archive_milestone.py +10 -118
- package/skills/path/scripts/bootstrap_repository.py +25 -3
- package/skills/path/scripts/build_recovery.py +287 -0
- package/skills/path/scripts/check_docs_audit.py +5 -3
- package/skills/path/scripts/check_handoffs.py +1 -1
- package/skills/path/scripts/detect_project.py +11 -2
- package/skills/path/scripts/dispatch_driver.py +4 -2
- package/skills/path/scripts/integration.py +28 -22
- package/skills/path/scripts/isolation.py +9 -1
- package/skills/path/scripts/lean_verification.py +1 -1
- package/skills/path/scripts/pipeline_state.py +114 -186
- package/skills/path/scripts/promote_lookahead.py +30 -162
- package/skills/path/scripts/roadmap.py +321 -0
- package/skills/path/scripts/state_checkpoint.py +109 -72
- package/skills/path/scripts/state_promote.py +42 -44
- package/skills/path/scripts/task_context.py +73 -0
- package/skills/path/scripts/token_budget.py +40 -1
- package/skills/path/scripts/workflow_run.py +116 -7
- package/skills/path/templates/wave-review.md +1 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# gsd-path project runtime
|
|
2
|
+
"""Guard a blocked build's return to Define or Plan using its committed base."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
import re
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
EVENTS = {
|
|
12
|
+
"define": "build intent corrections requested",
|
|
13
|
+
"plan": "build plan repair requested",
|
|
14
|
+
}
|
|
15
|
+
MARKER = "build recovery: "
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def runtime():
|
|
19
|
+
if __package__:
|
|
20
|
+
from scripts import pipeline_state
|
|
21
|
+
else:
|
|
22
|
+
import pipeline_state
|
|
23
|
+
return pipeline_state
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def checkpoint_runtime():
|
|
27
|
+
if __package__:
|
|
28
|
+
from scripts import state_checkpoint
|
|
29
|
+
else:
|
|
30
|
+
import state_checkpoint
|
|
31
|
+
return state_checkpoint
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def context(repo: Path, text: str | None = None) -> dict | None:
|
|
35
|
+
state = runtime()
|
|
36
|
+
current, loaded, _ = state.load_state(repo)
|
|
37
|
+
text = loaded if text is None else text
|
|
38
|
+
recovery = None
|
|
39
|
+
for line in text.splitlines():
|
|
40
|
+
if " — " not in line:
|
|
41
|
+
continue
|
|
42
|
+
event = line.split(" — ", 2)[-1]
|
|
43
|
+
if event.startswith(MARKER):
|
|
44
|
+
try:
|
|
45
|
+
value = json.loads(event[len(MARKER):])
|
|
46
|
+
except ValueError as error:
|
|
47
|
+
raise state.PipelineStateError("invalid build recovery record") from error
|
|
48
|
+
if (not isinstance(value, dict) or set(value) != {"base", "branch", "kind"}
|
|
49
|
+
or value["kind"] not in EVENTS
|
|
50
|
+
or not isinstance(value["base"], str)
|
|
51
|
+
or not re.fullmatch(r"[0-9a-f]{40}", value["base"])):
|
|
52
|
+
raise state.PipelineStateError("invalid build recovery record")
|
|
53
|
+
recovery = {**value, "active": True} if value["branch"] == current.branch else None
|
|
54
|
+
elif event == "build started" and recovery:
|
|
55
|
+
recovery["active"] = False
|
|
56
|
+
if recovery:
|
|
57
|
+
if not state._is_ancestor(repo, recovery["base"], "HEAD"):
|
|
58
|
+
raise state.PipelineStateError("build recovery base is not an ancestor of HEAD")
|
|
59
|
+
source = checkpoint_runtime()._git_text_at(repo, recovery["base"], ".project/STATE.md")
|
|
60
|
+
if source is None:
|
|
61
|
+
raise state.PipelineStateError("build recovery base has no STATE.md")
|
|
62
|
+
before = state._state_from_text(source)
|
|
63
|
+
if ((before.phase, before.status) != ("build", "blocked")
|
|
64
|
+
or before.branch != current.branch or before.milestone != current.milestone):
|
|
65
|
+
raise state.PipelineStateError("build recovery base does not prove this blocked milestone")
|
|
66
|
+
return recovery
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def task_fields(text: str, label: str) -> dict:
|
|
70
|
+
if __package__:
|
|
71
|
+
from scripts.isolation import task_frontmatter
|
|
72
|
+
else:
|
|
73
|
+
from isolation import task_frontmatter
|
|
74
|
+
fields, error = task_frontmatter(text)
|
|
75
|
+
if fields is None:
|
|
76
|
+
raise runtime().PipelineStateError(f"{label}: {error}")
|
|
77
|
+
return fields
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def settled_tasks(repo: Path) -> dict[str, tuple[str, dict]]:
|
|
81
|
+
"""Read task ownership without requiring the graph that Plan must repair."""
|
|
82
|
+
state = runtime()
|
|
83
|
+
directory = repo / ".project/tasks"
|
|
84
|
+
if directory.is_symlink() or not directory.is_dir():
|
|
85
|
+
raise state.PipelineStateError("build recovery requires real task artifacts")
|
|
86
|
+
tasks = {}
|
|
87
|
+
for path in sorted(directory.iterdir()):
|
|
88
|
+
if not re.fullmatch(r"T[0-9]{3}-[a-z0-9][a-z0-9-]*\.md", path.name):
|
|
89
|
+
raise state.PipelineStateError(f"invalid recovery task path: {path.name}")
|
|
90
|
+
text = state._read_real_file(path, path.name)
|
|
91
|
+
fields = task_fields(text, path.name)
|
|
92
|
+
if fields.get("status") not in {"pending", "done"}:
|
|
93
|
+
raise state.PipelineStateError(f"settle task ownership before recovery: {path.name}")
|
|
94
|
+
if fields["status"] == "pending" and any(
|
|
95
|
+
fields.get(key) != "null" for key in ("agent", "base", "worktree", "task_branch")
|
|
96
|
+
):
|
|
97
|
+
raise state.PipelineStateError(f"pending task retains dispatch metadata: {path.name}")
|
|
98
|
+
tasks[path.name] = (text, fields)
|
|
99
|
+
if not tasks:
|
|
100
|
+
raise state.PipelineStateError("build recovery requires task artifacts")
|
|
101
|
+
return tasks
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def begin(repo: Path, before, after, event: str) -> dict:
|
|
105
|
+
state = runtime()
|
|
106
|
+
if (before.phase, before.status) != ("build", "blocked") or after.phase not in EVENTS:
|
|
107
|
+
raise state.PipelineStateError("build recovery requires build/blocked")
|
|
108
|
+
if event != EVENTS[after.phase]:
|
|
109
|
+
raise state.PipelineStateError(f"state transition requires event: {EVENTS[after.phase]}")
|
|
110
|
+
if before.archive is not None or before.branch != state._current_branch(repo):
|
|
111
|
+
raise state.PipelineStateError("build recovery requires the active bound branch")
|
|
112
|
+
if state._worktree_changes(repo):
|
|
113
|
+
raise state.PipelineStateError("checkpoint the blocked build before recovery")
|
|
114
|
+
if any(state.transaction_journals(repo).values()):
|
|
115
|
+
raise state.PipelineStateError("finish pending transactions before build recovery")
|
|
116
|
+
records = records_root(repo)
|
|
117
|
+
for directory in {path.parent.parent for path in records.rglob("attempt-*/state.json")}:
|
|
118
|
+
latest = max(directory.glob("attempt-*/state.json"), key=lambda path: int(path.parent.name.split("-")[1]))
|
|
119
|
+
record = state._read_json(latest)
|
|
120
|
+
if (record.get("cleanup_pending")
|
|
121
|
+
or (record.get("worktree") and record.get("branch") and not record.get("cleanup_complete"))
|
|
122
|
+
or record.get("outcome") not in {"landed", "collected", "blocked", "resolved", "redispatched"}):
|
|
123
|
+
raise state.PipelineStateError(f"settle dispatch records before recovery: {latest}")
|
|
124
|
+
tasks = settled_tasks(repo)
|
|
125
|
+
state._read_real_file(repo / ".project/plan/PLAN.md", "PLAN.md")
|
|
126
|
+
state._read_real_file(repo / ".project/intent/INTENT.md", "INTENT.md")
|
|
127
|
+
base = state._run_git(repo, "rev-parse", "HEAD").stdout.strip()
|
|
128
|
+
done = [repo / ".project/tasks" / name for name, (_, fields) in tasks.items()
|
|
129
|
+
if fields["status"] == "done"]
|
|
130
|
+
if done:
|
|
131
|
+
if __package__:
|
|
132
|
+
from scripts.isolation import verify_landed_task_files
|
|
133
|
+
else:
|
|
134
|
+
from isolation import verify_landed_task_files
|
|
135
|
+
verify_landed_task_files(repo, done, ".project/tasks", base)
|
|
136
|
+
return {"kind": after.phase, "base": base, "branch": before.branch}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def records_root(repo: Path) -> Path:
|
|
140
|
+
if __package__:
|
|
141
|
+
from scripts import isolation
|
|
142
|
+
else:
|
|
143
|
+
import isolation
|
|
144
|
+
root = isolation.common_git_dir(repo) / "gsd-path/dispatch" / isolation.require_bound(repo).replace("/", "-")
|
|
145
|
+
recovery = context(repo)
|
|
146
|
+
return root / recovery["base"] if recovery else root
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def review_backup(repo: Path, recovery: dict) -> Path:
|
|
150
|
+
return repo / ".project/plan" / f"build-recovery-{recovery['base']}" / "review"
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def validate_review_backup(repo: Path, recovery: dict, directory: Path) -> None:
|
|
154
|
+
state = runtime()
|
|
155
|
+
if directory.exists():
|
|
156
|
+
checkpoint_runtime()._tree_digest(directory) # Reject symlinks and special files before reading.
|
|
157
|
+
expected = {}
|
|
158
|
+
for path in state._run_git(repo, "ls-tree", "-r", "--name-only", "-z",
|
|
159
|
+
recovery["base"], "--", ".project/review").stdout.split("\0"):
|
|
160
|
+
if path:
|
|
161
|
+
expected[str(Path(path).relative_to(".project/review"))] = checkpoint_runtime()._git_text_at(repo, recovery["base"], path)
|
|
162
|
+
actual = {str(path.relative_to(directory)): path.read_text(encoding="utf-8")
|
|
163
|
+
for path in directory.rglob("*") if path.is_file()} if directory.exists() else {}
|
|
164
|
+
if actual != expected:
|
|
165
|
+
raise state.PipelineStateError("review backup differs from the recovery base")
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def prepare(repo: Path) -> dict:
|
|
169
|
+
"""Move old reviews once; the durable STATE record owns interruption recovery."""
|
|
170
|
+
state = runtime()
|
|
171
|
+
repo = state._repo_root(repo)
|
|
172
|
+
with state._state_lock(repo / ".project"):
|
|
173
|
+
recovery = context(repo)
|
|
174
|
+
if not recovery or not recovery["active"]:
|
|
175
|
+
raise state.PipelineStateError("no active build recovery")
|
|
176
|
+
target = review_backup(repo, recovery)
|
|
177
|
+
if (repo / ".project/plan").is_symlink() or target.parent.is_symlink() or target.is_symlink():
|
|
178
|
+
raise state.PipelineStateError("unsafe recovery review backup")
|
|
179
|
+
source = repo / ".project/review"
|
|
180
|
+
if source.is_symlink():
|
|
181
|
+
raise state.PipelineStateError("unsafe recovery review directory")
|
|
182
|
+
if not target.exists():
|
|
183
|
+
validate_review_backup(repo, recovery, source)
|
|
184
|
+
target.parent.mkdir(exist_ok=True)
|
|
185
|
+
if source.exists():
|
|
186
|
+
source.rename(target)
|
|
187
|
+
else:
|
|
188
|
+
target.mkdir()
|
|
189
|
+
validate_review_backup(repo, recovery, target)
|
|
190
|
+
source.mkdir(exist_ok=True)
|
|
191
|
+
return {"status": "prepared", "recovery": recovery, "path": str(target)}
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def validate_plan(repo: Path) -> None:
|
|
195
|
+
state = runtime()
|
|
196
|
+
recovery = context(repo)
|
|
197
|
+
if not recovery or not recovery["active"]:
|
|
198
|
+
return
|
|
199
|
+
if not review_backup(repo, recovery).is_dir():
|
|
200
|
+
raise state.PipelineStateError("run prepare-build-recovery before planning")
|
|
201
|
+
validate_review_backup(repo, recovery, review_backup(repo, recovery))
|
|
202
|
+
source = checkpoint_runtime()._task_contracts_at(repo, recovery["base"], ".project/tasks")
|
|
203
|
+
current = settled_tasks(repo)
|
|
204
|
+
done = set()
|
|
205
|
+
for _, (path, text) in source.items():
|
|
206
|
+
fields = task_fields(text, path)
|
|
207
|
+
if fields.get("status") == "done":
|
|
208
|
+
name = Path(path).name
|
|
209
|
+
done.add(name)
|
|
210
|
+
if name not in current or current[name][0] != text:
|
|
211
|
+
raise state.PipelineStateError(f"build recovery must preserve landed task: {name}")
|
|
212
|
+
if any(fields["status"] == "done" and name not in done
|
|
213
|
+
for name, (_, fields) in current.items()):
|
|
214
|
+
raise state.PipelineStateError("build recovery cannot manufacture landed tasks")
|
|
215
|
+
if recovery["kind"] == "plan":
|
|
216
|
+
intent = checkpoint_runtime()._git_text_at(repo, recovery["base"], ".project/intent/INTENT.md")
|
|
217
|
+
if state._read_real_file(repo / ".project/intent/INTENT.md", "INTENT.md") != intent:
|
|
218
|
+
raise state.PipelineStateError("plan repair cannot change approved intent")
|
|
219
|
+
unchanged = unchanged_waves(repo, recovery)
|
|
220
|
+
for path in (repo / ".project/review").iterdir():
|
|
221
|
+
match = re.match(r"wave-([1-9]\d*)[.]", path.name)
|
|
222
|
+
if match and int(match[1]) not in unchanged:
|
|
223
|
+
raise state.PipelineStateError("changed wave must be reviewed after build resumes")
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def unchanged_waves(repo: Path, recovery: dict) -> set[int]:
|
|
227
|
+
"""Reuse evidence only when its intent, wave contract, and task bytes match."""
|
|
228
|
+
state = runtime()
|
|
229
|
+
project = repo / ".project"
|
|
230
|
+
old_intent = checkpoint_runtime()._git_text_at(repo, recovery["base"], ".project/intent/INTENT.md")
|
|
231
|
+
if state._read_real_file(project / "intent/INTENT.md", "INTENT.md") != old_intent:
|
|
232
|
+
return set()
|
|
233
|
+
old_plan = checkpoint_runtime()._git_text_at(repo, recovery["base"], ".project/plan/PLAN.md") or ""
|
|
234
|
+
new_plan = state._read_real_file(project / "plan/PLAN.md", "PLAN.md")
|
|
235
|
+
|
|
236
|
+
def sections(text):
|
|
237
|
+
return {match[1]: match[2] for match in re.finditer(
|
|
238
|
+
r"(?ms)^## ([^\n]+)\n(.*?)(?=^## |\Z)", text,
|
|
239
|
+
)}
|
|
240
|
+
|
|
241
|
+
old_sections, new_sections = sections(old_plan), sections(new_plan)
|
|
242
|
+
# Non-wave settings govern every wave, including coverage and surfaces.
|
|
243
|
+
if ({k: v for k, v in old_sections.items() if not k.startswith("Wave ")}
|
|
244
|
+
!= {k: v for k, v in new_sections.items() if not k.startswith("Wave ")}):
|
|
245
|
+
return set()
|
|
246
|
+
old_tasks = checkpoint_runtime()._task_contracts_at(repo, recovery["base"], ".project/tasks")
|
|
247
|
+
current = settled_tasks(repo)
|
|
248
|
+
unchanged = set()
|
|
249
|
+
for title, body in new_sections.items():
|
|
250
|
+
match = re.match(r"Wave ([1-9]\d*)\b", title)
|
|
251
|
+
if not match or old_sections.get(title) != body:
|
|
252
|
+
continue
|
|
253
|
+
wave = match[1]
|
|
254
|
+
before = {Path(path).name: text for path, text in old_tasks.values()
|
|
255
|
+
if task_fields(text, path).get("wave") == wave}
|
|
256
|
+
after = {name: text for name, (text, fields) in current.items() if fields.get("wave") == wave}
|
|
257
|
+
if before and before == after:
|
|
258
|
+
unchanged.add(int(wave))
|
|
259
|
+
return unchanged
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def restore_unchanged_reviews(repo: Path) -> None:
|
|
263
|
+
recovery = context(repo)
|
|
264
|
+
if not recovery or not recovery["active"]:
|
|
265
|
+
return
|
|
266
|
+
unchanged = unchanged_waves(repo, recovery)
|
|
267
|
+
for path in review_backup(repo, recovery).iterdir():
|
|
268
|
+
match = re.match(r"wave-([1-9]\d*)[.]", path.name)
|
|
269
|
+
if match and int(match[1]) in unchanged:
|
|
270
|
+
destination = repo / ".project/review" / path.name
|
|
271
|
+
content = path.read_text(encoding="utf-8")
|
|
272
|
+
if not destination.exists() or runtime()._read_real_file(destination, destination.name) != content:
|
|
273
|
+
runtime()._atomic_write(destination, content)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def inventory_checkpoint(repo: Path, head: str) -> bool:
|
|
277
|
+
state = runtime()
|
|
278
|
+
if state._run_git(repo, "show", "-s", "--format=%s", head).stdout.strip() != state.PLAN_APPROVAL_SUBJECT:
|
|
279
|
+
return False
|
|
280
|
+
text = checkpoint_runtime()._git_text_at(repo, head, ".project/STATE.md")
|
|
281
|
+
if text is None:
|
|
282
|
+
return False
|
|
283
|
+
approved = state._state_from_text(text)
|
|
284
|
+
if (approved.phase, approved.status) != ("plan", "done"):
|
|
285
|
+
return False
|
|
286
|
+
recovery = context(repo, text)
|
|
287
|
+
return bool(recovery and recovery["active"])
|
|
@@ -21,7 +21,8 @@ are rejected.
|
|
|
21
21
|
The frozen inventory travels in the dispatch brief; pass it with
|
|
22
22
|
`--inventory FILE` (one POSIX path per line, `-` for stdin). Without it the
|
|
23
23
|
gate derives the inventory from tracked Markdown files, excluding `.git`,
|
|
24
|
-
`node_modules`, `.project/archive/**`, installed `*/skills/gsd-path*`
|
|
24
|
+
`node_modules`, `.project/archive/**`, installed `*/skills/gsd-path*` and
|
|
25
|
+
`*/skills/path` bundles,
|
|
25
26
|
the audit itself, and — unless the
|
|
26
27
|
audit declares `Alignment mode: yes` — everything else under `.project/`.
|
|
27
28
|
"""
|
|
@@ -100,9 +101,10 @@ def _not_placeholder(value: str, label: str) -> None:
|
|
|
100
101
|
|
|
101
102
|
|
|
102
103
|
def _installed_skill(parts: Sequence[str]) -> bool:
|
|
103
|
-
"""
|
|
104
|
+
"""Exclude installed GSD Path bundles, including the path router alias."""
|
|
104
105
|
return any(
|
|
105
|
-
parts[index] == "skills" and
|
|
106
|
+
parts[index] == "skills" and
|
|
107
|
+
(parts[index + 1].startswith("gsd-path") or parts[index + 1] == "path")
|
|
106
108
|
for index in range(len(parts) - 2)
|
|
107
109
|
)
|
|
108
110
|
|
|
@@ -1462,7 +1462,7 @@ def validate_wave_evidence(
|
|
|
1462
1462
|
raise HandoffError(f"{name} Cycle field does not match its filename")
|
|
1463
1463
|
if _line_value(text, "Depth:") != expected_depth:
|
|
1464
1464
|
raise HandoffError(f"{name} Depth does not match PLAN.md")
|
|
1465
|
-
lens_fields = re.findall(r"(?m)^Lens
|
|
1465
|
+
lens_fields = re.findall(r"(?m)^Lens:[ \t]*(\S.*?)[ \t]*$", text)
|
|
1466
1466
|
if lens is None and lens_fields:
|
|
1467
1467
|
raise HandoffError(f"{name} must not declare a review lens")
|
|
1468
1468
|
if lens is not None and lens_fields != [lens]:
|
|
@@ -1439,7 +1439,7 @@ def write_state_anchored(
|
|
|
1439
1439
|
|
|
1440
1440
|
|
|
1441
1441
|
def initialize(
|
|
1442
|
-
repo: Path, template: Path, phase: Optional[str] = None
|
|
1442
|
+
repo: Path, template: Path, phase: Optional[str] = None, *, require_git: bool = False
|
|
1443
1443
|
) -> dict:
|
|
1444
1444
|
if phase is not None and phase not in {"inspect", "define"}:
|
|
1445
1445
|
raise DetectError(f"initialize phase must be inspect or define: {phase}")
|
|
@@ -1458,6 +1458,13 @@ def initialize(
|
|
|
1458
1458
|
if payload["verdict"] not in {"brownfield", "greenfield"}:
|
|
1459
1459
|
payload["wrote_state"] = False
|
|
1460
1460
|
return payload
|
|
1461
|
+
if require_git:
|
|
1462
|
+
git = subprocess.run(
|
|
1463
|
+
["git", "-C", str(root), "rev-parse", "--is-inside-work-tree"],
|
|
1464
|
+
env=git_environment(), capture_output=True, text=True, check=False,
|
|
1465
|
+
)
|
|
1466
|
+
if git.returncode != 0 or git.stdout.strip() != "true":
|
|
1467
|
+
return {**payload, "route": "setup-repository", "wrote_state": False}
|
|
1461
1468
|
expected = "inspect" if payload["verdict"] == "brownfield" else "define"
|
|
1462
1469
|
if phase is None:
|
|
1463
1470
|
phase = expected
|
|
@@ -1491,6 +1498,7 @@ def parser() -> argparse.ArgumentParser:
|
|
|
1491
1498
|
result.add_argument("--repo", type=Path, required=True)
|
|
1492
1499
|
result.add_argument("--template", type=Path)
|
|
1493
1500
|
result.add_argument("--phase", choices=("inspect", "define"))
|
|
1501
|
+
result.add_argument("--require-git", action="store_true")
|
|
1494
1502
|
return result
|
|
1495
1503
|
|
|
1496
1504
|
|
|
@@ -1503,7 +1511,8 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
|
|
|
1503
1511
|
if arguments.template is None:
|
|
1504
1512
|
raise DetectError("initialize requires --template")
|
|
1505
1513
|
payload = initialize(
|
|
1506
|
-
arguments.repo, arguments.template, arguments.phase
|
|
1514
|
+
arguments.repo, arguments.template, arguments.phase,
|
|
1515
|
+
require_git=arguments.require_git
|
|
1507
1516
|
)
|
|
1508
1517
|
return emit(payload, 2 if payload.get("error") else 0)
|
|
1509
1518
|
raise DetectError(f"unknown command: {arguments.command}")
|
|
@@ -31,13 +31,14 @@ from typing import BinaryIO, Callable, Dict, List, Optional
|
|
|
31
31
|
|
|
32
32
|
try:
|
|
33
33
|
from scripts import (_common, archive_milestone, build_state, discussion_validate, isolation,
|
|
34
|
-
pipeline_state, review_findings, review_panel, workflow_run)
|
|
34
|
+
pipeline_state, review_findings, review_panel, workflow_run, task_context)
|
|
35
35
|
from scripts import check_handoffs as contracts
|
|
36
36
|
except ImportError: # bundled copy inside a skill's scripts directory
|
|
37
37
|
import _common
|
|
38
38
|
import archive_milestone
|
|
39
39
|
import build_state
|
|
40
40
|
import check_handoffs as contracts
|
|
41
|
+
import task_context
|
|
41
42
|
import discussion_validate
|
|
42
43
|
import isolation
|
|
43
44
|
import pipeline_state
|
|
@@ -94,7 +95,7 @@ def milestone_slug(primary: Path) -> str:
|
|
|
94
95
|
|
|
95
96
|
|
|
96
97
|
def records_root(primary: Path) -> Path:
|
|
97
|
-
return
|
|
98
|
+
return pipeline_state._build_recovery().records_root(primary)
|
|
98
99
|
|
|
99
100
|
|
|
100
101
|
def budget_ledger(primary: Path) -> Path:
|
|
@@ -246,6 +247,7 @@ def brief_text(state: Dict[str, object], role_brief: Path, task_template: Path)
|
|
|
246
247
|
if state.get("answered"):
|
|
247
248
|
lines.append(f"The task Log now records an `{ANSWER_MARK}` to your earlier question; "
|
|
248
249
|
"continue from it.")
|
|
250
|
+
lines.append(task_context.render(worktree, worktree / str(state['task_file'])))
|
|
249
251
|
return "\n".join(lines) + "\n"
|
|
250
252
|
|
|
251
253
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# gsd-path project runtime
|
|
3
|
-
"""
|
|
3
|
+
"""Own milestone integration, publication, tags, and completion proof."""
|
|
4
4
|
|
|
5
5
|
import json
|
|
6
6
|
import re
|
|
@@ -37,6 +37,20 @@ except ImportError: # pragma: no cover - package import used by tests
|
|
|
37
37
|
from scripts import _common
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
if __package__:
|
|
41
|
+
from . import archive_milestone
|
|
42
|
+
from .archive_milestone import ArchiveError
|
|
43
|
+
else:
|
|
44
|
+
import archive_milestone
|
|
45
|
+
from archive_milestone import ArchiveError
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
PR_CREDIT_LINE = (
|
|
49
|
+
"PR prepared with [GSD Path](https://github.com/open-gsd/gsd-path)."
|
|
50
|
+
)
|
|
51
|
+
GITHUB_HOST = "github.com"
|
|
52
|
+
|
|
53
|
+
|
|
40
54
|
run_git = _common.run_git
|
|
41
55
|
run_command = _common.run_command
|
|
42
56
|
|
|
@@ -1208,7 +1222,7 @@ def find_integrate_commit(
|
|
|
1208
1222
|
return merge_commit
|
|
1209
1223
|
|
|
1210
1224
|
|
|
1211
|
-
def validate_integrated(repo: Path, slug: str) -> dict:
|
|
1225
|
+
def validate_integrated(repo: Path, slug: str, *, refresh: bool = True) -> dict:
|
|
1212
1226
|
project = repo.resolve()
|
|
1213
1227
|
active_root = archive_milestone.require_project_layout(project)
|
|
1214
1228
|
state, _, loaded_state_path = archive_milestone.strict_state(project)
|
|
@@ -1228,7 +1242,8 @@ def validate_integrated(repo: Path, slug: str) -> dict:
|
|
|
1228
1242
|
|
|
1229
1243
|
# Refresh whenever origin exists so direct mode cannot miss a published tag.
|
|
1230
1244
|
# Fixtures that only plant refs/remotes/origin/* keep resolve_remote_default.
|
|
1231
|
-
|
|
1245
|
+
has_origin = run_git(project, "remote", "get-url", "origin").returncode == 0
|
|
1246
|
+
if has_origin and refresh:
|
|
1232
1247
|
remote_default = refresh_origin(project)["remote_default"]
|
|
1233
1248
|
else:
|
|
1234
1249
|
remote_default = resolve_remote_default(project)
|
|
@@ -1348,6 +1363,16 @@ def validate_integrated(repo: Path, slug: str) -> dict:
|
|
|
1348
1363
|
"mode": state.integration,
|
|
1349
1364
|
"tag": tag_name,
|
|
1350
1365
|
}
|
|
1366
|
+
if has_origin and not refresh:
|
|
1367
|
+
# Status must not fetch or write refs. Missing/stale local evidence is
|
|
1368
|
+
# unverified; the normal ship validator remains the refresh owner.
|
|
1369
|
+
refs = [(f"refs/heads/{default_name}", result["base"]),
|
|
1370
|
+
(f"refs/tags/{tag_name}", optional_ref(project, tag_ref))]
|
|
1371
|
+
if state.integration == "direct":
|
|
1372
|
+
refs.append((f"refs/heads/{bound_branch}", ship_commit))
|
|
1373
|
+
for ref, expected in refs:
|
|
1374
|
+
if live_remote_ref(project, ref) != expected:
|
|
1375
|
+
raise ArchiveError(f"published {ref} differs from local integration evidence")
|
|
1351
1376
|
if pull_request is not None:
|
|
1352
1377
|
result["pull_request"] = pull_request
|
|
1353
1378
|
return result
|
|
@@ -1412,22 +1437,3 @@ def require_published_integration(
|
|
|
1412
1437
|
raise ArchiveError(
|
|
1413
1438
|
f"published milestone tag {tag_name} does not point at the integration merge"
|
|
1414
1439
|
)
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
# archive_milestone imports this module, so the parent is resolved after the
|
|
1418
|
-
# definitions above. Parent functions are looked up on the module at call time
|
|
1419
|
-
# so patches applied to archive_milestone stay visible here.
|
|
1420
|
-
if __package__: # imported as scripts.integration
|
|
1421
|
-
from . import archive_milestone
|
|
1422
|
-
from .archive_milestone import (
|
|
1423
|
-
GITHUB_HOST,
|
|
1424
|
-
PR_CREDIT_LINE,
|
|
1425
|
-
ArchiveError,
|
|
1426
|
-
)
|
|
1427
|
-
else: # standalone script or sibling import
|
|
1428
|
-
import archive_milestone
|
|
1429
|
-
from archive_milestone import (
|
|
1430
|
-
GITHUB_HOST,
|
|
1431
|
-
PR_CREDIT_LINE,
|
|
1432
|
-
ArchiveError,
|
|
1433
|
-
)
|
|
@@ -2016,7 +2016,15 @@ def _recovery_task_inventory(
|
|
|
2016
2016
|
relative_posix_dir = PurePosixPath(relative_dir.as_posix())
|
|
2017
2017
|
revisions = [head]
|
|
2018
2018
|
parents = git_output(primary, "show", "-s", "--format=%P", head).split()
|
|
2019
|
-
|
|
2019
|
+
# A recovery plan checkpoint owns replacement of unstarted task briefs.
|
|
2020
|
+
# Ordinary commits still require the parent inventory so a deletion cannot
|
|
2021
|
+
# silently hide a task from recovery.
|
|
2022
|
+
if __package__:
|
|
2023
|
+
from scripts import build_recovery
|
|
2024
|
+
else:
|
|
2025
|
+
import build_recovery
|
|
2026
|
+
replaced = build_recovery.inventory_checkpoint(primary, head)
|
|
2027
|
+
if parents and not replaced:
|
|
2020
2028
|
revisions.append(parents[0])
|
|
2021
2029
|
tracked = set()
|
|
2022
2030
|
for revision in revisions:
|
|
@@ -94,7 +94,7 @@ def _final_view(relative, text, criteria, reviewed, head):
|
|
|
94
94
|
f"- **Reference**: {relative} — {criterion}",
|
|
95
95
|
"- **Finding**: none", "- **Fix direction**: none"]
|
|
96
96
|
if "Surface" in fields:
|
|
97
|
-
lines.append(f"- **Surface**: {fields['Surface']}")
|
|
97
|
+
lines.append(f"- **Surface**: {contracts._unquoted(fields['Surface']).partition(',')[0]}")
|
|
98
98
|
lines.append("")
|
|
99
99
|
return "\n".join(lines)
|
|
100
100
|
|