@pennyfarthing/core 11.1.1 → 11.2.1
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/README.md +8 -8
- package/package.json +2 -1
- package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -1
- package/packages/core/dist/cli/commands/doctor.js +381 -66
- package/packages/core/dist/cli/commands/doctor.js.map +1 -1
- package/packages/core/dist/cli/commands/init.js +4 -4
- package/packages/core/dist/cli/commands/init.js.map +1 -1
- package/packages/core/dist/cli/commands/update.d.ts.map +1 -1
- package/packages/core/dist/cli/commands/update.js +4 -5
- package/packages/core/dist/cli/commands/update.js.map +1 -1
- package/packages/core/dist/cli/utils/constants.d.ts +3 -8
- package/packages/core/dist/cli/utils/constants.d.ts.map +1 -1
- package/packages/core/dist/cli/utils/constants.js +3 -4
- package/packages/core/dist/cli/utils/constants.js.map +1 -1
- package/packages/core/dist/cli/utils/settings.d.ts +11 -0
- package/packages/core/dist/cli/utils/settings.d.ts.map +1 -1
- package/packages/core/dist/cli/utils/settings.js +65 -29
- package/packages/core/dist/cli/utils/settings.js.map +1 -1
- package/packages/core/dist/cli/utils/symlinks.js +16 -16
- package/packages/core/dist/cli/utils/symlinks.js.map +1 -1
- package/packages/core/dist/consultation/tandem-metrics.d.ts +91 -0
- package/packages/core/dist/consultation/tandem-metrics.d.ts.map +1 -0
- package/packages/core/dist/consultation/tandem-metrics.js +131 -0
- package/packages/core/dist/consultation/tandem-metrics.js.map +1 -0
- package/packages/core/dist/consultation/tandem-metrics.test.d.ts +18 -0
- package/packages/core/dist/consultation/tandem-metrics.test.d.ts.map +1 -0
- package/packages/core/dist/consultation/tandem-metrics.test.js +457 -0
- package/packages/core/dist/consultation/tandem-metrics.test.js.map +1 -0
- package/packages/core/dist/public/js/react/react.js +14 -14
- package/packages/core/dist/scripts/benchmark-integration.d.ts +182 -0
- package/packages/core/dist/scripts/benchmark-integration.d.ts.map +1 -0
- package/packages/core/dist/scripts/benchmark-integration.js +691 -0
- package/packages/core/dist/scripts/benchmark-integration.js.map +1 -0
- package/packages/core/dist/scripts/job-fair-aggregator.d.ts +150 -0
- package/packages/core/dist/scripts/job-fair-aggregator.d.ts.map +1 -0
- package/packages/core/dist/scripts/job-fair-aggregator.js +547 -0
- package/packages/core/dist/scripts/job-fair-aggregator.js.map +1 -0
- package/packages/core/dist/server/api/agent-load.js +1 -1
- package/packages/core/dist/server/api/agent-load.js.map +1 -1
- package/packages/core/dist/server/otlp-receiver.d.ts +16 -11
- package/packages/core/dist/server/otlp-receiver.d.ts.map +1 -1
- package/packages/core/dist/server/otlp-receiver.js +185 -24
- package/packages/core/dist/server/otlp-receiver.js.map +1 -1
- package/packages/core/dist/server/otlp-receiver.test.d.ts +21 -0
- package/packages/core/dist/server/otlp-receiver.test.d.ts.map +1 -0
- package/packages/core/dist/server/otlp-receiver.test.js +446 -0
- package/packages/core/dist/server/otlp-receiver.test.js.map +1 -0
- package/packages/core/dist/server/server.d.ts +0 -3
- package/packages/core/dist/server/server.d.ts.map +1 -1
- package/packages/core/dist/server/server.js +3 -37
- package/packages/core/dist/server/server.js.map +1 -1
- package/packages/core/dist/server/server.test.d.ts +1 -1
- package/packages/core/dist/server/server.test.js +12 -23
- package/packages/core/dist/server/server.test.js.map +1 -1
- package/packages/core/dist/shared/capabilities.d.ts +88 -0
- package/packages/core/dist/shared/capabilities.d.ts.map +1 -0
- package/packages/core/dist/shared/capabilities.js +133 -0
- package/packages/core/dist/shared/capabilities.js.map +1 -0
- package/packages/core/dist/shared/capabilities.test.d.ts +2 -0
- package/packages/core/dist/shared/capabilities.test.d.ts.map +1 -0
- package/packages/core/dist/shared/capabilities.test.js +217 -0
- package/packages/core/dist/shared/capabilities.test.js.map +1 -0
- package/packages/core/dist/shared/portrait-resolver.d.ts +9 -0
- package/packages/core/dist/shared/portrait-resolver.d.ts.map +1 -1
- package/packages/core/dist/shared/portrait-resolver.js +27 -0
- package/packages/core/dist/shared/portrait-resolver.js.map +1 -1
- package/packages/core/dist/shared/portrait-resolver.test.js +47 -1
- package/packages/core/dist/shared/portrait-resolver.test.js.map +1 -1
- package/packages/core/dist/shared/spawn-prompt.d.ts +47 -0
- package/packages/core/dist/shared/spawn-prompt.d.ts.map +1 -0
- package/packages/core/dist/shared/spawn-prompt.js +82 -0
- package/packages/core/dist/shared/spawn-prompt.js.map +1 -0
- package/packages/core/dist/shared/spawn-prompt.test.d.ts +2 -0
- package/packages/core/dist/shared/spawn-prompt.test.d.ts.map +1 -0
- package/packages/core/dist/shared/spawn-prompt.test.js +251 -0
- package/packages/core/dist/shared/spawn-prompt.test.js.map +1 -0
- package/packages/core/dist/shared/tandem-portrait-inventory.test.d.ts +13 -0
- package/packages/core/dist/shared/tandem-portrait-inventory.test.d.ts.map +1 -0
- package/packages/core/dist/shared/tandem-portrait-inventory.test.js +126 -0
- package/packages/core/dist/shared/tandem-portrait-inventory.test.js.map +1 -0
- package/packages/core/dist/workflow/tandem-workflow-templates.test.d.ts +18 -0
- package/packages/core/dist/workflow/tandem-workflow-templates.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/tandem-workflow-templates.test.js +434 -0
- package/packages/core/dist/workflow/tandem-workflow-templates.test.js.map +1 -0
- package/packages/core/dist/workflow/workflow-schema.d.ts +32 -0
- package/packages/core/dist/workflow/workflow-schema.d.ts.map +1 -1
- package/packages/core/dist/workflow/workflow-schema.js +120 -0
- package/packages/core/dist/workflow/workflow-schema.js.map +1 -1
- package/packages/core/dist/workflow/workflow-schema.test.d.ts.map +1 -1
- package/packages/core/dist/workflow/workflow-schema.test.js +570 -1
- package/packages/core/dist/workflow/workflow-schema.test.js.map +1 -1
- package/pennyfarthing-dist/agents/dev.md +7 -11
- package/pennyfarthing-dist/agents/reviewer.md +9 -3
- package/pennyfarthing-dist/agents/sm-finish.md +18 -1
- package/pennyfarthing-dist/agents/sm-setup.md +1 -1
- package/pennyfarthing-dist/agents/sm.md +2 -2
- package/pennyfarthing-dist/agents/tea.md +1 -1
- package/pennyfarthing-dist/agents/testing-runner.md +2 -1
- package/pennyfarthing-dist/commands/pf-chore.md +2 -2
- package/pennyfarthing-dist/commands/pf-git.md +4 -2
- package/pennyfarthing-dist/commands/pf-standalone.md +7 -2
- package/pennyfarthing-dist/gates/approval.md +63 -0
- package/pennyfarthing-dist/gates/confidence-sm.md +71 -0
- package/pennyfarthing-dist/gates/context-ok.md +56 -0
- package/pennyfarthing-dist/gates/evaluations/confidence-sm.md +54 -0
- package/pennyfarthing-dist/gates/quality-pass.md +67 -0
- package/pennyfarthing-dist/gates/tests-fail.md +84 -0
- package/pennyfarthing-dist/gates/tests-pass.md +79 -0
- package/pennyfarthing-dist/guides/agent-behavior.md +23 -19
- package/pennyfarthing-dist/guides/agent-tag-taxonomy.md +1 -1
- package/pennyfarthing-dist/guides/bell-mode.md +1 -1
- package/pennyfarthing-dist/guides/bikerack.md +3 -3
- package/pennyfarthing-dist/guides/hooks.md +29 -29
- package/pennyfarthing-dist/guides/reflector.md +1 -1
- package/pennyfarthing-dist/guides/tandem-protocol.md +3 -3
- package/pennyfarthing-dist/guides/worktree-mode.md +3 -3
- package/pennyfarthing-dist/guides/xml-tags.md +2 -2
- package/pennyfarthing-dist/scripts/README.md +1 -1
- package/pennyfarthing-dist/scripts/core/check-context.sh +3 -1
- package/pennyfarthing-dist/scripts/core/phase-check-start.sh +5 -87
- package/pennyfarthing-dist/scripts/git/README.md +24 -14
- package/pennyfarthing-dist/scripts/git/create-feature-branches.sh +5 -266
- package/pennyfarthing-dist/scripts/git/git-status-all.sh +5 -151
- package/pennyfarthing-dist/scripts/git/install-git-hooks.sh +6 -144
- package/pennyfarthing-dist/scripts/git/worktree-manager.sh +5 -496
- package/pennyfarthing-dist/scripts/hooks/README.md +6 -6
- package/pennyfarthing-dist/scripts/hooks/__pycache__/question_reflector_check.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/scripts/hooks/bell-mode-hook.sh +4 -183
- package/pennyfarthing-dist/scripts/hooks/context-circuit-breaker.sh +4 -95
- package/pennyfarthing-dist/scripts/hooks/context-warning.sh +4 -65
- package/pennyfarthing-dist/scripts/hooks/cyclist-pretooluse-hook.sh +3 -31
- package/pennyfarthing-dist/scripts/hooks/otel-auto-config.sh +9 -11
- package/pennyfarthing-dist/scripts/hooks/pre-commit.sh +27 -33
- package/pennyfarthing-dist/scripts/hooks/pre-edit-check.sh +4 -71
- package/pennyfarthing-dist/scripts/hooks/question-reflector-check.sh +3 -19
- package/pennyfarthing-dist/scripts/hooks/schema-validation.sh +4 -30
- package/pennyfarthing-dist/scripts/hooks/session-start.sh +3 -32
- package/pennyfarthing-dist/scripts/hooks/session-stop.sh +4 -65
- package/pennyfarthing-dist/scripts/hooks/sprint-yaml-validation.sh +4 -78
- package/pennyfarthing-dist/scripts/hooks/welcome-hook.sh +4 -93
- package/pennyfarthing-dist/scripts/misc/README.md +1 -1
- package/pennyfarthing-dist/scripts/misc/statusline.sh +4 -301
- package/pennyfarthing-dist/scripts/portraits/generate-tandem-portraits.sh +76 -0
- package/pennyfarthing-dist/scripts/workflow/fix-session-phase.sh +4 -221
- package/pennyfarthing-dist/scripts/workflow/get-workflow-type.sh +5 -13
- package/pennyfarthing-dist/scripts/workflow/list-workflows.sh +4 -123
- package/pennyfarthing-dist/scripts/workflow/phase-owner.sh +4 -33
- package/pennyfarthing-dist/scripts/workflow/resume-workflow.sh +4 -156
- package/pennyfarthing-dist/scripts/workflow/show-workflow.sh +4 -131
- package/pennyfarthing-dist/scripts/workflow/start-workflow.sh +4 -249
- package/pennyfarthing-dist/scripts/workflow/workflow-status.sh +4 -160
- package/pennyfarthing-dist/skills/pf-bc/usage.md +1 -1
- package/pennyfarthing-dist/skills/pf-jira/examples.md +5 -2
- package/pennyfarthing-dist/skills/pf-workflow/examples.md +27 -16
- package/pennyfarthing-dist/skills/pf-workflow/skill.md +9 -12
- package/pennyfarthing-dist/skills/pf-workflow/usage.md +33 -8
- package/pennyfarthing-dist/templates/settings.local.json.template +19 -10
- package/pennyfarthing-dist/workflows/bdd-tandem.yaml +18 -6
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-01-analyze.md +1 -1
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-04-verify.md +1 -1
- package/pennyfarthing-dist/workflows/git-cleanup/steps/step-05-complete.md +1 -1
- package/pennyfarthing-dist/workflows/review-tandem.yaml +65 -0
- package/pennyfarthing-dist/workflows/tdd-tandem.yaml +16 -8
- package/pennyfarthing-dist/workflows/tdd.yaml +11 -2
- package/pennyfarthing_scripts/CLAUDE.md +45 -14
- package/pennyfarthing_scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/bellmode_hook.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/config.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/context.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/hooks.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_bidirectional_sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_epic_creation.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_sync_story.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/output.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/patch_mode.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/pretooluse_hook.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/schema_validation_hook.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/session_start_hook.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/sprint.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/workflow.cpython-311.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bc/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bc/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bc/__pycache__/focus.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bc/cli.py +3 -5
- package/pennyfarthing_scripts/bellmode_hook.py +12 -296
- package/pennyfarthing_scripts/bikerack/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/audit_log_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/background_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/base_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/changed_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/context_meter_footer.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/debug_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/diffs_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/events.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/git_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/launcher.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/portrait_resolver.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/progress_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/sprint_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/story_detail_data.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/story_detail_screen.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/tui.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/ws_client.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/audit_log_panel.py +119 -0
- package/pennyfarthing_scripts/bikerack/background_panel.py +86 -5
- package/pennyfarthing_scripts/bikerack/base_panel.py +87 -2
- package/pennyfarthing_scripts/bikerack/changed_panel.py +125 -29
- package/pennyfarthing_scripts/bikerack/context_meter_footer.py +88 -0
- package/pennyfarthing_scripts/bikerack/debug_panel.py +32 -2
- package/pennyfarthing_scripts/bikerack/diffs_panel.py +104 -17
- package/pennyfarthing_scripts/bikerack/events.py +28 -0
- package/pennyfarthing_scripts/bikerack/git_panel.py +103 -33
- package/pennyfarthing_scripts/bikerack/launcher.py +15 -15
- package/pennyfarthing_scripts/bikerack/portrait_resolver.py +139 -0
- package/pennyfarthing_scripts/bikerack/progress_panel.py +315 -0
- package/pennyfarthing_scripts/bikerack/sprint_panel.py +395 -32
- package/pennyfarthing_scripts/bikerack/story_detail_data.py +244 -0
- package/pennyfarthing_scripts/bikerack/story_detail_screen.py +176 -0
- package/pennyfarthing_scripts/bikerack/tui.py +575 -37
- package/pennyfarthing_scripts/bikerack/ws_client.py +2 -2
- package/pennyfarthing_scripts/brownfield/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/discover.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/cli.py +42 -65
- package/pennyfarthing_scripts/codemarkers/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/config.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/output.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/themes.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/pr_config.py +38 -0
- package/pennyfarthing_scripts/complexity/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/consultation/__init__.py +1 -0
- package/pennyfarthing_scripts/consultation/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/consultation/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/consultation/__pycache__/dialogue_manager.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/consultation/cli.py +149 -0
- package/pennyfarthing_scripts/consultation/dialogue_manager.py +417 -0
- package/pennyfarthing_scripts/context.py +3 -3
- package/pennyfarthing_scripts/deadcode/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/epic/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/epic/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__init__.py +12 -1
- package/pennyfarthing_scripts/git/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/create_branches.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/status_all.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/create_branches.py +3 -4
- package/pennyfarthing_scripts/git/hooks_installer.py +152 -0
- package/pennyfarthing_scripts/git/repos.py +196 -0
- package/pennyfarthing_scripts/git/status_all.py +27 -11
- package/pennyfarthing_scripts/git/worktree.py +302 -0
- package/pennyfarthing_scripts/git_group/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git_group/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git_group/cli.py +143 -40
- package/pennyfarthing_scripts/handoff/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/complete_phase.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/gate_file.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/gate_runner.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/marker.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/resolve_gate.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/cli.py +33 -1
- package/pennyfarthing_scripts/handoff/complete_phase.py +40 -0
- package/pennyfarthing_scripts/handoff/marker.py +15 -15
- package/pennyfarthing_scripts/handoff/phase_check.py +96 -0
- package/pennyfarthing_scripts/handoff/resolve_gate.py +18 -15
- package/pennyfarthing_scripts/healthscore/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__init__.py +437 -0
- package/pennyfarthing_scripts/hooks/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/bell_mode.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/context_breaker.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/context_warning.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/cyclist_pretooluse.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/pre_edit_check.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/reflector_check.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/schema_validation.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/session_start.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/session_stop.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/sprint_yaml_validation.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/statusline.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/bell_mode.py +215 -0
- package/pennyfarthing_scripts/hooks/cli.py +96 -0
- package/pennyfarthing_scripts/hooks/context_breaker.py +104 -0
- package/pennyfarthing_scripts/hooks/context_warning.py +66 -0
- package/pennyfarthing_scripts/hooks/cyclist_pretooluse.py +129 -0
- package/pennyfarthing_scripts/hooks/pre_edit_check.py +78 -0
- package/pennyfarthing_scripts/hooks/reflector_check.py +271 -0
- package/pennyfarthing_scripts/hooks/schema_validation.py +203 -0
- package/pennyfarthing_scripts/hooks/session_start.py +296 -0
- package/pennyfarthing_scripts/hooks/session_stop.py +111 -0
- package/pennyfarthing_scripts/hooks/sprint_yaml_validation.py +97 -0
- package/pennyfarthing_scripts/hooks/statusline.py +420 -0
- package/pennyfarthing_scripts/hooks.py +27 -446
- package/pennyfarthing_scripts/hotspots/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/bidirectional.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/claim.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/client.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/compat.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/create.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/epic.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/mappings.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/operations.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/reconcile.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/story.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/launch/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/launch/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/session.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/skill.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/step.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/validate.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/finish.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/pretooluse_hook.py +3 -185
- package/pennyfarthing_scripts/prime/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/persona.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/session.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/tiers.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/version_sentinel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/heatmap.py +655 -0
- package/pennyfarthing_scripts/prime/workflow.py +2 -1
- package/pennyfarthing_scripts/schema_validation_hook.py +3 -298
- package/pennyfarthing_scripts/session/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/session/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/session_start_hook.py +4 -186
- package/pennyfarthing_scripts/sprint/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/archive.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/archive_epic.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/epic_add.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/epic_update.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/import_epic.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/status.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/story_add.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/story_finish.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/story_update.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/validate_cmd.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/validator.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/work.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/yaml_io.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/loader.py +15 -1
- package/pennyfarthing_scripts/sprint/story_update.py +19 -0
- package/pennyfarthing_scripts/story/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/create.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/size.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/template.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/conftest.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_108_1_gate_migration.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_archive_epic.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_bc.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_bikerack.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_brownfield.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_cli_modules.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_cli_normalization.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_codemarkers.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_common.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_confidence_sm_evaluation.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_confidence_sm_gate.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_dialogue_manager.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_epic_shard_validation.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_git_utils.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_handoff_cli.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_handoff_e2e.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_healthscore.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_jira_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_package_structure.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_patch_mode.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_prime.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_panel.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_validator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_story_add.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_story_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_story_update.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_tiers.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_token_counting.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_topology_loader.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_tui_focus.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_tui_panel_persistence.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_validate_cmd.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_version_sentinel.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_workflow_check.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_workflow_cli.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_yaml_io.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/test_bikerack.py +51 -51
- package/pennyfarthing_scripts/tests/test_dialogue_manager.py +811 -0
- package/pennyfarthing_scripts/tests/test_handoff_cli.py +16 -11
- package/pennyfarthing_scripts/tests/test_sprint_panel.py +344 -265
- package/pennyfarthing_scripts/tests/test_workflow_check.py +2 -3
- package/pennyfarthing_scripts/theme/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/theme/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/agent.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/schema.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/skill_command.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/sprint.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/tandem_awareness.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/tandem_awareness.py +254 -0
- package/pennyfarthing_scripts/validate/adapters/workflow.py +19 -0
- package/pennyfarthing_scripts/validate/cli.py +17 -5
- package/pennyfarthing_scripts/welcome_hook.py +3 -149
- package/pennyfarthing_scripts/workflow/__init__.py +40 -0
- package/pennyfarthing_scripts/workflow/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/__pycache__/helpers.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/__pycache__/scale.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/__pycache__/state.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/cli.py +1100 -0
- package/pennyfarthing_scripts/workflow/helpers.py +241 -0
- package/pennyfarthing_scripts/{workflow.py → workflow/scale.py} +0 -104
- package/pennyfarthing_scripts/workflow/state.py +112 -0
- package/pennyfarthing_scripts/workflow/team_lifecycle.py +257 -0
- package/packages/core/dist/scripts/theme-detail.test.d.ts +0 -10
- package/packages/core/dist/scripts/theme-detail.test.js +0 -199
- package/pennyfarthing-dist/skills/pf-workflow/scripts/list-workflows.sh +0 -91
- package/pennyfarthing-dist/skills/pf-workflow/scripts/resume-workflow.sh +0 -163
- package/pennyfarthing-dist/skills/pf-workflow/scripts/show-workflow.sh +0 -138
- package/pennyfarthing-dist/skills/pf-workflow/scripts/start-workflow.sh +0 -273
- package/pennyfarthing-dist/skills/pf-workflow/scripts/workflow-status.sh +0 -167
- package/pennyfarthing_scripts/gate/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/gate/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/gate/__pycache__/validate.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_108_2_remove_handoff_fallback.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_gate_file_resolution.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_gate_runner.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_resolve_gate_file_field.cpython-314-pytest-9.0.2.pyc +0 -0
|
@@ -1,222 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# fix-session-phase.sh MSSCI-12190 approved --dry-run
|
|
7
|
-
#
|
|
8
|
-
# This script detects the current phase, validates the target phase is reachable,
|
|
9
|
-
# and updates the session file's Workflow Tracking section:
|
|
10
|
-
# - Updates **Phase:** field to target phase
|
|
11
|
-
# - Adds missing rows to Phase History table
|
|
12
|
-
# - Adds missing rows to Handoff History table
|
|
13
|
-
#
|
|
14
|
-
# Valid phases for TDD workflow: setup → red → green → review → approved → finish
|
|
15
|
-
# Valid phases for trivial workflow: setup → implement → review → approved → finish
|
|
16
|
-
|
|
17
|
-
set -euo pipefail
|
|
18
|
-
|
|
19
|
-
STORY_ID="${1:-}"
|
|
20
|
-
TARGET_PHASE="${2:-}"
|
|
21
|
-
DRY_RUN=false
|
|
22
|
-
|
|
23
|
-
# Parse options
|
|
24
|
-
for arg in "$@"; do
|
|
25
|
-
case $arg in
|
|
26
|
-
--dry-run)
|
|
27
|
-
DRY_RUN=true
|
|
28
|
-
;;
|
|
29
|
-
esac
|
|
30
|
-
done
|
|
31
|
-
|
|
32
|
-
if [[ -z "$STORY_ID" ]] || [[ -z "$TARGET_PHASE" ]]; then
|
|
33
|
-
echo "Usage: fix-session-phase.sh <story-id> <target-phase> [--dry-run]"
|
|
34
|
-
echo ""
|
|
35
|
-
echo "Arguments:"
|
|
36
|
-
echo " story-id Story ID (e.g., 56-1 or MSSCI-12190)"
|
|
37
|
-
echo " target-phase Target phase to set (e.g., review, approved, finish)"
|
|
38
|
-
echo ""
|
|
39
|
-
echo "Options:"
|
|
40
|
-
echo " --dry-run Show what would be done without executing"
|
|
41
|
-
echo ""
|
|
42
|
-
echo "Examples:"
|
|
43
|
-
echo " fix-session-phase.sh 56-1 review # Update to review phase"
|
|
44
|
-
echo " fix-session-phase.sh 56-1 approved # Update to approved phase"
|
|
45
|
-
echo " fix-session-phase.sh 56-1 finish --dry-run # Preview finish update"
|
|
46
|
-
exit 1
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
# Find project root
|
|
50
|
-
source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
|
|
51
|
-
|
|
52
|
-
# Try multiple session file naming patterns
|
|
53
|
-
SESSION_FILE=""
|
|
54
|
-
STORY_ID_LOWER=$(echo "$STORY_ID" | tr '[:upper:]' '[:lower:]')
|
|
55
|
-
for pattern in "${STORY_ID}-session.md" "${STORY_ID_LOWER}-session.md"; do
|
|
56
|
-
if [[ -f "$PROJECT_ROOT/.session/$pattern" ]]; then
|
|
57
|
-
SESSION_FILE="$PROJECT_ROOT/.session/$pattern"
|
|
58
|
-
break
|
|
59
|
-
fi
|
|
60
|
-
done
|
|
61
|
-
|
|
62
|
-
# Also try without the epic prefix (e.g., MSSCI-12190 might be in 56-1-session.md)
|
|
63
|
-
if [[ -z "$SESSION_FILE" ]]; then
|
|
64
|
-
# Search for session files containing this story ID
|
|
65
|
-
found=$(grep -l "Jira:.*$STORY_ID\|ID:.*$STORY_ID" "$PROJECT_ROOT/.session/"*-session.md 2>/dev/null | head -1 || echo "")
|
|
66
|
-
if [[ -n "$found" ]]; then
|
|
67
|
-
SESSION_FILE="$found"
|
|
68
|
-
fi
|
|
69
|
-
fi
|
|
70
|
-
|
|
71
|
-
if [[ -z "$SESSION_FILE" ]] || [[ ! -f "$SESSION_FILE" ]]; then
|
|
72
|
-
echo "Error: Session file not found for story $STORY_ID"
|
|
73
|
-
echo "Searched in: $PROJECT_ROOT/.session/"
|
|
74
|
-
exit 1
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
echo "Session file: $SESSION_FILE"
|
|
78
|
-
|
|
79
|
-
# Extract current state
|
|
80
|
-
CURRENT_PHASE=$(grep -E '^\*\*Phase:\*\*' "$SESSION_FILE" | sed 's/\*\*Phase:\*\* //' | tr -d ' ' || echo "unknown")
|
|
81
|
-
WORKFLOW=$(grep -E '^\*\*Workflow:\*\*' "$SESSION_FILE" | head -1 | sed 's/\*\*Workflow:\*\* //' | tr -d ' ' || echo "tdd")
|
|
82
|
-
PHASE_STARTED=$(grep -E '^\*\*Phase Started:\*\*' "$SESSION_FILE" | sed 's/\*\*Phase Started:\*\* //' | tr -d ' ' || echo "")
|
|
83
|
-
|
|
84
|
-
echo "Current phase: $CURRENT_PHASE"
|
|
85
|
-
echo "Target phase: $TARGET_PHASE"
|
|
86
|
-
echo "Workflow: $WORKFLOW"
|
|
87
|
-
|
|
88
|
-
# Define valid phase sequences
|
|
89
|
-
case "$WORKFLOW" in
|
|
90
|
-
tdd)
|
|
91
|
-
PHASES=("setup" "red" "green" "review" "approved" "finish")
|
|
92
|
-
AGENTS=("sm" "tea" "dev" "reviewer" "sm" "sm")
|
|
93
|
-
GATES=("manual" "tests_fail" "tests_pass" "approval" "complete" "")
|
|
94
|
-
;;
|
|
95
|
-
trivial)
|
|
96
|
-
PHASES=("setup" "implement" "review" "approved" "finish")
|
|
97
|
-
AGENTS=("sm" "dev" "reviewer" "sm" "sm")
|
|
98
|
-
GATES=("manual" "tests_pass" "approval" "complete" "")
|
|
99
|
-
;;
|
|
100
|
-
*)
|
|
101
|
-
echo "Warning: Unknown workflow '$WORKFLOW', assuming TDD"
|
|
102
|
-
PHASES=("setup" "red" "green" "review" "approved" "finish")
|
|
103
|
-
AGENTS=("sm" "tea" "dev" "reviewer" "sm" "sm")
|
|
104
|
-
GATES=("manual" "tests_fail" "tests_pass" "approval" "complete" "")
|
|
105
|
-
;;
|
|
106
|
-
esac
|
|
107
|
-
|
|
108
|
-
# Find indices
|
|
109
|
-
CURRENT_IDX=-1
|
|
110
|
-
TARGET_IDX=-1
|
|
111
|
-
for i in "${!PHASES[@]}"; do
|
|
112
|
-
if [[ "${PHASES[$i]}" == "$CURRENT_PHASE" ]]; then
|
|
113
|
-
CURRENT_IDX=$i
|
|
114
|
-
fi
|
|
115
|
-
if [[ "${PHASES[$i]}" == "$TARGET_PHASE" ]]; then
|
|
116
|
-
TARGET_IDX=$i
|
|
117
|
-
fi
|
|
118
|
-
done
|
|
119
|
-
|
|
120
|
-
if [[ $CURRENT_IDX -eq -1 ]]; then
|
|
121
|
-
echo "Error: Current phase '$CURRENT_PHASE' not found in $WORKFLOW workflow"
|
|
122
|
-
echo "Valid phases: ${PHASES[*]}"
|
|
123
|
-
exit 1
|
|
124
|
-
fi
|
|
125
|
-
|
|
126
|
-
if [[ $TARGET_IDX -eq -1 ]]; then
|
|
127
|
-
echo "Error: Target phase '$TARGET_PHASE' not found in $WORKFLOW workflow"
|
|
128
|
-
echo "Valid phases: ${PHASES[*]}"
|
|
129
|
-
exit 1
|
|
130
|
-
fi
|
|
131
|
-
|
|
132
|
-
if [[ $TARGET_IDX -le $CURRENT_IDX ]]; then
|
|
133
|
-
echo "Error: Target phase '$TARGET_PHASE' is not ahead of current phase '$CURRENT_PHASE'"
|
|
134
|
-
echo "Phase sequence: ${PHASES[*]}"
|
|
135
|
-
exit 1
|
|
136
|
-
fi
|
|
137
|
-
|
|
138
|
-
# Calculate what transitions are needed
|
|
139
|
-
echo ""
|
|
140
|
-
echo "Transitions needed:"
|
|
141
|
-
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
142
|
-
TRANSITIONS=()
|
|
143
|
-
|
|
144
|
-
for ((i=CURRENT_IDX; i<TARGET_IDX; i++)); do
|
|
145
|
-
FROM_PHASE="${PHASES[$i]}"
|
|
146
|
-
TO_PHASE="${PHASES[$((i+1))]}"
|
|
147
|
-
FROM_AGENT="${AGENTS[$i]}"
|
|
148
|
-
TO_AGENT="${AGENTS[$((i+1))]}"
|
|
149
|
-
GATE="${GATES[$((i+1))]}"
|
|
150
|
-
|
|
151
|
-
echo " $FROM_PHASE ($FROM_AGENT) → $TO_PHASE ($TO_AGENT) [gate: $GATE]"
|
|
152
|
-
TRANSITIONS+=("$FROM_PHASE|$TO_PHASE|$FROM_AGENT|$TO_AGENT|$GATE")
|
|
153
|
-
done
|
|
154
|
-
|
|
155
|
-
if [[ "$DRY_RUN" == "true" ]]; then
|
|
156
|
-
echo ""
|
|
157
|
-
echo "[DRY RUN] Would update session file with:"
|
|
158
|
-
echo " - **Phase:** $TARGET_PHASE"
|
|
159
|
-
echo " - **Phase Started:** $NOW"
|
|
160
|
-
echo " - Phase History: close out $CURRENT_PHASE, add intermediate phases"
|
|
161
|
-
echo " - Handoff History: add ${#TRANSITIONS[@]} handoff(s)"
|
|
162
|
-
exit 0
|
|
163
|
-
fi
|
|
164
|
-
|
|
165
|
-
echo ""
|
|
166
|
-
echo "Updating session file..."
|
|
167
|
-
|
|
168
|
-
# Build the Phase History additions
|
|
169
|
-
PHASE_HISTORY_ADDITIONS=""
|
|
170
|
-
HANDOFF_HISTORY_ADDITIONS=""
|
|
171
|
-
PREV_END="$NOW"
|
|
172
|
-
|
|
173
|
-
for transition in "${TRANSITIONS[@]}"; do
|
|
174
|
-
IFS='|' read -r FROM_PHASE TO_PHASE FROM_AGENT TO_AGENT GATE <<< "$transition"
|
|
175
|
-
|
|
176
|
-
# Add phase history row (close out the FROM phase)
|
|
177
|
-
# We'll use NOW for ended time since we don't know actual times
|
|
178
|
-
PHASE_HISTORY_ADDITIONS+="| $FROM_PHASE | - | $NOW | - |\n"
|
|
179
|
-
|
|
180
|
-
# Add handoff history row
|
|
181
|
-
HANDOFF_HISTORY_ADDITIONS+="| $FROM_AGENT | $TO_AGENT | $GATE | PASSED | $NOW |\n"
|
|
182
|
-
done
|
|
183
|
-
|
|
184
|
-
# Update the **Phase:** line
|
|
185
|
-
sed -i.bak "s/^\*\*Phase:\*\*.*/\*\*Phase:\*\* $TARGET_PHASE/" "$SESSION_FILE"
|
|
186
|
-
|
|
187
|
-
# Update the **Phase Started:** line
|
|
188
|
-
sed -i.bak "s/^\*\*Phase Started:\*\*.*/\*\*Phase Started:\*\* $NOW/" "$SESSION_FILE"
|
|
189
|
-
|
|
190
|
-
# Close out the current phase in Phase History (update the row that has "| - | - |" at the end)
|
|
191
|
-
# This is tricky - we need to find the row for current phase and add end time
|
|
192
|
-
# For now, we'll add a note about manual review needed
|
|
193
|
-
|
|
194
|
-
# Add handoff history rows before the "## Story Context" section
|
|
195
|
-
if [[ -n "$HANDOFF_HISTORY_ADDITIONS" ]]; then
|
|
196
|
-
# Find the last handoff history row and add after it
|
|
197
|
-
# The handoff history table ends before a blank line or next section
|
|
198
|
-
|
|
199
|
-
# Use awk to insert after the last handoff history row
|
|
200
|
-
awk -v additions="$HANDOFF_HISTORY_ADDITIONS" '
|
|
201
|
-
/^\| .* \| .* \| .* \| .* \| .*\|$/ && /PASSED|FAILED/ {
|
|
202
|
-
last_handoff = NR
|
|
203
|
-
last_handoff_line = $0
|
|
204
|
-
}
|
|
205
|
-
{
|
|
206
|
-
print
|
|
207
|
-
if (NR == last_handoff && additions != "") {
|
|
208
|
-
printf "%s", additions
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
' "$SESSION_FILE" > "$SESSION_FILE.tmp" && mv "$SESSION_FILE.tmp" "$SESSION_FILE"
|
|
212
|
-
fi
|
|
213
|
-
|
|
214
|
-
# Clean up backup
|
|
215
|
-
rm -f "$SESSION_FILE.bak"
|
|
216
|
-
|
|
217
|
-
echo ""
|
|
218
|
-
echo "✓ Session file updated"
|
|
219
|
-
echo " Phase: $CURRENT_PHASE → $TARGET_PHASE"
|
|
220
|
-
echo " Handoffs added: ${#TRANSITIONS[@]}"
|
|
221
|
-
echo ""
|
|
222
|
-
echo "Note: Phase History end times set to now. Review and adjust if needed."
|
|
2
|
+
# DEPRECATED: Use `pf workflow fix-phase` instead.
|
|
3
|
+
# This shim forwards to the Python CLI for backward compatibility.
|
|
4
|
+
echo "Warning: fix-session-phase.sh is deprecated. Use: pf workflow fix-phase $*" >&2
|
|
5
|
+
exec pf workflow fix-phase "$@"
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
#!/
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# Returns: "phased" or "stepped"
|
|
7
|
-
# Exit 1 if workflow not found
|
|
8
|
-
|
|
9
|
-
set -euo pipefail
|
|
10
|
-
|
|
11
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
12
|
-
|
|
13
|
-
exec python3 "$SCRIPT_DIR/get-workflow-type.py" "$@"
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# DEPRECATED: Use `pf workflow type` instead.
|
|
3
|
+
# This shim forwards to the Python CLI for backward compatibility.
|
|
4
|
+
echo "Warning: get-workflow-type.sh is deprecated. Use: pf workflow type $*" >&2
|
|
5
|
+
exec pf workflow type "$@"
|
|
@@ -1,124 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# MSSCI-12083: Added type, steps, and modes columns
|
|
7
|
-
|
|
8
|
-
set -euo pipefail
|
|
9
|
-
|
|
10
|
-
# Find project root
|
|
11
|
-
source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
|
|
12
|
-
|
|
13
|
-
WORKFLOWS_DIR="$PROJECT_ROOT/.pennyfarthing/workflows"
|
|
14
|
-
|
|
15
|
-
if [[ ! -d "$WORKFLOWS_DIR" ]]; then
|
|
16
|
-
echo "Error: Workflows directory not found at $WORKFLOWS_DIR"
|
|
17
|
-
exit 1
|
|
18
|
-
fi
|
|
19
|
-
|
|
20
|
-
if ! command -v yq &> /dev/null; then
|
|
21
|
-
echo "Error: yq is required but not installed"
|
|
22
|
-
echo "Install with: brew install yq"
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
echo "# Available Workflows"
|
|
27
|
-
echo ""
|
|
28
|
-
echo "| Workflow | Type | Default | Steps/Phases | Modes | Description |"
|
|
29
|
-
echo "|----------|------|---------|--------------|-------|-------------|"
|
|
30
|
-
|
|
31
|
-
# Find all workflow YAML files: top-level *.yaml and subdirectory workflow.yaml files
|
|
32
|
-
workflow_files=()
|
|
33
|
-
while IFS= read -r -d '' f; do
|
|
34
|
-
workflow_files+=("$f")
|
|
35
|
-
done < <(find -L "$WORKFLOWS_DIR" -maxdepth 1 -name "*.yaml" -print0 2>/dev/null)
|
|
36
|
-
while IFS= read -r -d '' f; do
|
|
37
|
-
workflow_files+=("$f")
|
|
38
|
-
done < <(find -L "$WORKFLOWS_DIR" -mindepth 2 -name "workflow.yaml" -print0 2>/dev/null)
|
|
39
|
-
|
|
40
|
-
# Exit early if no workflows found
|
|
41
|
-
if [[ ${#workflow_files[@]} -eq 0 ]]; then
|
|
42
|
-
echo "No workflows found in $WORKFLOWS_DIR"
|
|
43
|
-
exit 0
|
|
44
|
-
fi
|
|
45
|
-
|
|
46
|
-
# Sort by workflow name for consistent output
|
|
47
|
-
IFS=$'\n' sorted_files=($(printf '%s\n' "${workflow_files[@]}" | sort))
|
|
48
|
-
unset IFS
|
|
49
|
-
|
|
50
|
-
for f in "${sorted_files[@]}"; do
|
|
51
|
-
[[ -f "$f" ]] || continue
|
|
52
|
-
|
|
53
|
-
name=$(yq eval '.workflow.name' "$f")
|
|
54
|
-
desc=$(yq eval '.workflow.description' "$f" | head -1)
|
|
55
|
-
is_default=$(yq eval '.workflow.triggers.default // false' "$f")
|
|
56
|
-
|
|
57
|
-
# Detect workflow type (stepped, phased, or procedural)
|
|
58
|
-
# Stepped workflows have .workflow.type == "stepped" or .workflow.steps
|
|
59
|
-
# Procedural workflows have .workflow.type == "procedural" (BMAD reference workflows)
|
|
60
|
-
workflow_type=$(yq eval '.workflow.type // "phased"' "$f")
|
|
61
|
-
has_steps=$(yq eval '.workflow.steps != null' "$f")
|
|
62
|
-
|
|
63
|
-
if [[ "$has_steps" == "true" ]] || [[ "$workflow_type" == "stepped" ]]; then
|
|
64
|
-
type_col="stepped"
|
|
65
|
-
# Count step files if steps.path is defined
|
|
66
|
-
steps_path=$(yq eval '.workflow.steps.path // ""' "$f")
|
|
67
|
-
steps_pattern=$(yq eval '.workflow.steps.pattern // "step-*.md"' "$f")
|
|
68
|
-
# Resolve steps_path relative to the workflow file's directory
|
|
69
|
-
workflow_dir=$(dirname "$f")
|
|
70
|
-
if [[ -n "$steps_path" ]]; then
|
|
71
|
-
# Handle relative paths (./steps/ or steps/)
|
|
72
|
-
if [[ "$steps_path" == ./* ]]; then
|
|
73
|
-
resolved_path="$workflow_dir/${steps_path#./}"
|
|
74
|
-
elif [[ "$steps_path" != /* ]]; then
|
|
75
|
-
resolved_path="$workflow_dir/$steps_path"
|
|
76
|
-
else
|
|
77
|
-
resolved_path="$steps_path"
|
|
78
|
-
fi
|
|
79
|
-
if [[ -d "$resolved_path" ]]; then
|
|
80
|
-
step_count=$(find "$resolved_path" -maxdepth 1 -name "step-*.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
81
|
-
steps_col="${step_count} steps"
|
|
82
|
-
else
|
|
83
|
-
steps_col="-"
|
|
84
|
-
fi
|
|
85
|
-
else
|
|
86
|
-
steps_col="-"
|
|
87
|
-
fi
|
|
88
|
-
elif [[ "$workflow_type" == "procedural" ]]; then
|
|
89
|
-
type_col="procedural"
|
|
90
|
-
# Procedural workflows use instructions.md instead of phases/steps
|
|
91
|
-
steps_col="instructions"
|
|
92
|
-
else
|
|
93
|
-
type_col="phased"
|
|
94
|
-
# Count phases for phased workflows
|
|
95
|
-
phase_count=$(yq eval '.workflow.phases | length' "$f")
|
|
96
|
-
steps_col="${phase_count} phases"
|
|
97
|
-
fi
|
|
98
|
-
|
|
99
|
-
# Default column
|
|
100
|
-
if [[ "$is_default" == "true" ]]; then
|
|
101
|
-
default_col="yes"
|
|
102
|
-
else
|
|
103
|
-
default_col="no"
|
|
104
|
-
fi
|
|
105
|
-
|
|
106
|
-
# Modes column (for tri-modal workflows)
|
|
107
|
-
modes=$(yq eval '.workflow.modes.available // []' "$f")
|
|
108
|
-
if [[ "$modes" != "[]" ]] && [[ "$modes" != "null" ]]; then
|
|
109
|
-
# Format as comma-separated list
|
|
110
|
-
modes_col=$(yq eval '.workflow.modes.available | join(",")' "$f")
|
|
111
|
-
else
|
|
112
|
-
modes_col="-"
|
|
113
|
-
fi
|
|
114
|
-
|
|
115
|
-
echo "| $name | $type_col | $default_col | $steps_col | $modes_col | $desc |"
|
|
116
|
-
done
|
|
117
|
-
|
|
118
|
-
echo ""
|
|
119
|
-
echo "**Legend:**"
|
|
120
|
-
echo "- **phased**: Agent-driven workflow (SM → TEA → Dev → Reviewer)"
|
|
121
|
-
echo "- **stepped**: Step-by-step guided workflow with progressive disclosure"
|
|
122
|
-
echo "- **procedural**: BMAD reference workflow with instructions file"
|
|
123
|
-
echo ""
|
|
124
|
-
echo "Use \`/workflow show <name>\` for workflow details."
|
|
2
|
+
# DEPRECATED: Use `pf workflow list` instead.
|
|
3
|
+
# This shim forwards to the Python CLI for backward compatibility.
|
|
4
|
+
echo "Warning: list-workflows.sh is deprecated. Use: pf workflow list" >&2
|
|
5
|
+
exec pf workflow list "$@"
|
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
set -euo pipefail
|
|
7
|
-
|
|
8
|
-
WORKFLOW="${1:-}"
|
|
9
|
-
PHASE="${2:-}"
|
|
10
|
-
|
|
11
|
-
if [[ -z "$WORKFLOW" || -z "$PHASE" ]]; then
|
|
12
|
-
echo "Usage: phase-owner.sh <workflow> <phase>" >&2
|
|
13
|
-
exit 1
|
|
14
|
-
fi
|
|
15
|
-
|
|
16
|
-
# Find project root
|
|
17
|
-
source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
|
|
18
|
-
|
|
19
|
-
WORKFLOW_FILE="$PROJECT_ROOT/.pennyfarthing/workflows/${WORKFLOW}.yaml"
|
|
20
|
-
|
|
21
|
-
if [[ ! -f "$WORKFLOW_FILE" ]]; then
|
|
22
|
-
echo "Error: Workflow '$WORKFLOW' not found" >&2
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
# Query the agent for this phase
|
|
27
|
-
AGENT=$(yq eval ".workflow.phases[] | select(.name == \"$PHASE\") | .agent" "$WORKFLOW_FILE" 2>/dev/null)
|
|
28
|
-
|
|
29
|
-
if [[ -z "$AGENT" || "$AGENT" == "null" ]]; then
|
|
30
|
-
echo "Error: Phase '$PHASE' not found in workflow '$WORKFLOW'" >&2
|
|
31
|
-
exit 1
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
echo "$AGENT"
|
|
2
|
+
# DEPRECATED: Use `pf workflow phase-check` instead.
|
|
3
|
+
# This shim forwards to the Python CLI for backward compatibility.
|
|
4
|
+
echo "Warning: phase-owner.sh is deprecated. Use: pf workflow phase-check $*" >&2
|
|
5
|
+
exec pf workflow phase-check "$@"
|
|
@@ -1,157 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
# Find project root
|
|
10
|
-
source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
|
|
11
|
-
|
|
12
|
-
WORKFLOWS_DIR="$PROJECT_ROOT/.pennyfarthing/workflows"
|
|
13
|
-
SESSION_DIR="$PROJECT_ROOT/.session"
|
|
14
|
-
|
|
15
|
-
if ! command -v yq &> /dev/null; then
|
|
16
|
-
echo "Error: yq is required but not installed"
|
|
17
|
-
echo "Install with: brew install yq"
|
|
18
|
-
exit 1
|
|
19
|
-
fi
|
|
20
|
-
|
|
21
|
-
WORKFLOW_NAME="${1:-}"
|
|
22
|
-
|
|
23
|
-
# If no name, try to detect from session
|
|
24
|
-
if [[ -z "$WORKFLOW_NAME" ]]; then
|
|
25
|
-
# Look for workflow session files
|
|
26
|
-
SESSION_FILE=$(find "$SESSION_DIR" -maxdepth 1 -name "*-workflow-session.md" 2>/dev/null | head -1)
|
|
27
|
-
|
|
28
|
-
if [[ -z "$SESSION_FILE" ]]; then
|
|
29
|
-
echo "# Resume Stepped Workflow"
|
|
30
|
-
echo ""
|
|
31
|
-
echo "No active workflow session found."
|
|
32
|
-
echo ""
|
|
33
|
-
echo "Use \`/workflow start <name>\` to begin a new workflow."
|
|
34
|
-
exit 1
|
|
35
|
-
fi
|
|
36
|
-
|
|
37
|
-
# Extract workflow name from session
|
|
38
|
-
WORKFLOW_NAME=$(grep -E "^\*\*Workflow:\*\*" "$SESSION_FILE" 2>/dev/null | sed 's/\*\*Workflow:\*\* //' | tr -d ' ')
|
|
39
|
-
|
|
40
|
-
if [[ -z "$WORKFLOW_NAME" ]]; then
|
|
41
|
-
# Try extracting from filename
|
|
42
|
-
WORKFLOW_NAME=$(basename "$SESSION_FILE" | sed 's/-workflow-session.md//')
|
|
43
|
-
fi
|
|
44
|
-
else
|
|
45
|
-
SESSION_FILE="$SESSION_DIR/${WORKFLOW_NAME}-workflow-session.md"
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
if [[ ! -f "$SESSION_FILE" ]]; then
|
|
49
|
-
echo "Error: No session found for workflow '$WORKFLOW_NAME'"
|
|
50
|
-
echo ""
|
|
51
|
-
echo "Use \`/workflow start $WORKFLOW_NAME\` to begin."
|
|
52
|
-
exit 1
|
|
53
|
-
fi
|
|
54
|
-
|
|
55
|
-
# Find workflow file
|
|
56
|
-
WORKFLOW_FILE=""
|
|
57
|
-
if [[ -f "$WORKFLOWS_DIR/${WORKFLOW_NAME}.yaml" ]]; then
|
|
58
|
-
WORKFLOW_FILE="$WORKFLOWS_DIR/${WORKFLOW_NAME}.yaml"
|
|
59
|
-
elif [[ -f "$WORKFLOWS_DIR/${WORKFLOW_NAME}/workflow.yaml" ]]; then
|
|
60
|
-
WORKFLOW_FILE="$WORKFLOWS_DIR/${WORKFLOW_NAME}/workflow.yaml"
|
|
61
|
-
else
|
|
62
|
-
echo "Error: Workflow definition '$WORKFLOW_NAME' not found"
|
|
63
|
-
exit 1
|
|
64
|
-
fi
|
|
65
|
-
|
|
66
|
-
WORKFLOW_DIR=$(dirname "$WORKFLOW_FILE")
|
|
67
|
-
|
|
68
|
-
# Parse session state
|
|
69
|
-
CURRENT_STEP=$(grep -E "^\- \*\*Current Step:\*\*" "$SESSION_FILE" 2>/dev/null | sed 's/.*\*\* //' || echo "1")
|
|
70
|
-
MODE=$(grep -E "^\- \*\*Mode:\*\*" "$SESSION_FILE" 2>/dev/null | sed 's/.*\*\* //' || echo "create")
|
|
71
|
-
STATUS=$(grep -E "^\- \*\*Status:\*\*" "$SESSION_FILE" 2>/dev/null | sed 's/.*\*\* //' || echo "in_progress")
|
|
72
|
-
STEPS_COMPLETED=$(grep -E "^\- \*\*Steps Completed:\*\*" "$SESSION_FILE" 2>/dev/null | sed 's/.*\*\* //' || echo "[]")
|
|
73
|
-
|
|
74
|
-
# Check if workflow is complete
|
|
75
|
-
if [[ "$STATUS" == "completed" ]]; then
|
|
76
|
-
echo "# Workflow Complete: $WORKFLOW_NAME"
|
|
77
|
-
echo ""
|
|
78
|
-
echo "This workflow has already been completed."
|
|
79
|
-
echo ""
|
|
80
|
-
echo "To start a new session, delete the session file:"
|
|
81
|
-
echo "\`\`\`bash"
|
|
82
|
-
echo "rm \"$SESSION_FILE\""
|
|
83
|
-
echo "\`\`\`"
|
|
84
|
-
echo ""
|
|
85
|
-
echo "Then run \`/workflow start $WORKFLOW_NAME\`"
|
|
86
|
-
exit 0
|
|
87
|
-
fi
|
|
88
|
-
|
|
89
|
-
# Resolve steps path based on mode
|
|
90
|
-
MODE_PATH=$(yq eval ".workflow.modes.$MODE // \"\"" "$WORKFLOW_FILE")
|
|
91
|
-
if [[ -n "$MODE_PATH" && "$MODE_PATH" != "null" ]]; then
|
|
92
|
-
STEPS_PATH="$MODE_PATH"
|
|
93
|
-
else
|
|
94
|
-
STEPS_PATH=$(yq eval '.workflow.steps.path' "$WORKFLOW_FILE")
|
|
95
|
-
fi
|
|
96
|
-
|
|
97
|
-
# Resolve relative path
|
|
98
|
-
if [[ "$STEPS_PATH" == ./* ]]; then
|
|
99
|
-
STEPS_PATH="$WORKFLOW_DIR/${STEPS_PATH#./}"
|
|
100
|
-
elif [[ "$STEPS_PATH" != /* ]]; then
|
|
101
|
-
STEPS_PATH="$PROJECT_ROOT/$STEPS_PATH"
|
|
102
|
-
fi
|
|
103
|
-
|
|
104
|
-
# Count steps
|
|
105
|
-
STEP_COUNT=$(find "$STEPS_PATH" -maxdepth 1 -name "step-0*.md" -o -name "step-1*.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
106
|
-
|
|
107
|
-
# Find the current step file
|
|
108
|
-
# Handle various naming: step-01.md, step-01-name.md, step-1-name.md
|
|
109
|
-
PADDED_STEP=$(printf "%02d" "$CURRENT_STEP")
|
|
110
|
-
STEP_FILE=$(find "$STEPS_PATH" -maxdepth 1 \( -name "step-${PADDED_STEP}*.md" -o -name "step-${CURRENT_STEP}-*.md" \) 2>/dev/null | sort | head -1)
|
|
111
|
-
|
|
112
|
-
if [[ -z "$STEP_FILE" ]]; then
|
|
113
|
-
echo "Error: Could not find step $CURRENT_STEP file in $STEPS_PATH"
|
|
114
|
-
exit 1
|
|
115
|
-
fi
|
|
116
|
-
|
|
117
|
-
# Update last updated timestamp
|
|
118
|
-
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
119
|
-
sed -i '' "s/^\- \*\*Last Updated:\*\*.*/- **Last Updated:** $NOW/" "$SESSION_FILE" 2>/dev/null || true
|
|
120
|
-
|
|
121
|
-
# Calculate completion percentage
|
|
122
|
-
COMPLETED_COUNT=$(echo "$STEPS_COMPLETED" | tr -cd ',' | wc -c | tr -d ' ')
|
|
123
|
-
if [[ "$STEPS_COMPLETED" != "[]" ]]; then
|
|
124
|
-
COMPLETED_COUNT=$((COMPLETED_COUNT + 1))
|
|
125
|
-
fi
|
|
126
|
-
if [[ "$STEP_COUNT" -gt 0 ]]; then
|
|
127
|
-
COMPLETION_PCT=$((COMPLETED_COUNT * 100 / STEP_COUNT))
|
|
128
|
-
else
|
|
129
|
-
COMPLETION_PCT=0
|
|
130
|
-
fi
|
|
131
|
-
|
|
132
|
-
# Output resume info
|
|
133
|
-
echo "# Resuming Workflow: $WORKFLOW_NAME"
|
|
134
|
-
echo ""
|
|
135
|
-
echo "**Mode:** $MODE"
|
|
136
|
-
echo "**Progress:** Step $CURRENT_STEP of $STEP_COUNT ($COMPLETION_PCT% complete)"
|
|
137
|
-
echo "**Steps Completed:** $STEPS_COMPLETED"
|
|
138
|
-
echo "**Session:** $SESSION_FILE"
|
|
139
|
-
echo ""
|
|
140
|
-
echo "---"
|
|
141
|
-
echo ""
|
|
142
|
-
echo "## Step $CURRENT_STEP of $STEP_COUNT"
|
|
143
|
-
echo ""
|
|
144
|
-
|
|
145
|
-
# Output step content (strip frontmatter if present)
|
|
146
|
-
if head -1 "$STEP_FILE" | grep -q "^---$"; then
|
|
147
|
-
awk '/^---$/{if(++c==2){p=1;next}}p' "$STEP_FILE"
|
|
148
|
-
else
|
|
149
|
-
cat "$STEP_FILE"
|
|
150
|
-
fi
|
|
151
|
-
|
|
152
|
-
echo ""
|
|
153
|
-
echo "---"
|
|
154
|
-
echo ""
|
|
155
|
-
echo "**Controls:**"
|
|
156
|
-
echo "- \`C\` - Continue to next step"
|
|
157
|
-
echo "- \`/workflow status\` - Check progress"
|
|
2
|
+
# DEPRECATED: Use `pf workflow resume` instead.
|
|
3
|
+
# This shim forwards to the Python CLI for backward compatibility.
|
|
4
|
+
echo "Warning: resume-workflow.sh is deprecated. Use: pf workflow resume $*" >&2
|
|
5
|
+
exec pf workflow resume "$@"
|