@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
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Shared helpers for workflow commands.
|
|
3
|
+
|
|
4
|
+
Extracted from complete-step.py and bash scripts. Provides common
|
|
5
|
+
functions for session parsing, workflow file resolution, and step management.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import re
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
import yaml
|
|
14
|
+
|
|
15
|
+
from pennyfarthing_scripts.common.config import get_project_root
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def get_workflows_dir(project_root: Path | None = None) -> Path:
|
|
19
|
+
"""Get the workflows directory path."""
|
|
20
|
+
root = project_root or get_project_root()
|
|
21
|
+
return root / ".pennyfarthing" / "workflows"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def get_session_dir(project_root: Path | None = None) -> Path:
|
|
25
|
+
"""Get the session directory path."""
|
|
26
|
+
root = project_root or get_project_root()
|
|
27
|
+
return root / ".session"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def find_workflow_file(workflows_dir: Path, workflow_name: str) -> Path | None:
|
|
31
|
+
"""Find workflow YAML definition.
|
|
32
|
+
|
|
33
|
+
Supports both flat (name.yaml) and nested (name/workflow.yaml) layouts.
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
Path to the workflow file, or None if not found.
|
|
37
|
+
"""
|
|
38
|
+
flat = workflows_dir / f"{workflow_name}.yaml"
|
|
39
|
+
if flat.exists():
|
|
40
|
+
return flat
|
|
41
|
+
|
|
42
|
+
nested = workflows_dir / workflow_name / "workflow.yaml"
|
|
43
|
+
if nested.exists():
|
|
44
|
+
return nested
|
|
45
|
+
|
|
46
|
+
return None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def load_workflow_data(workflow_file: Path) -> dict:
|
|
50
|
+
"""Load and parse workflow YAML file.
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
Parsed YAML data dict.
|
|
54
|
+
"""
|
|
55
|
+
with open(workflow_file) as f:
|
|
56
|
+
return yaml.safe_load(f) or {}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def get_workflow_type(workflow_data: dict) -> str:
|
|
60
|
+
"""Get workflow type from parsed YAML data.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
'phased', 'stepped', or 'procedural'
|
|
64
|
+
"""
|
|
65
|
+
wf = workflow_data.get("workflow", {})
|
|
66
|
+
wf_type = wf.get("type", "phased")
|
|
67
|
+
has_steps = wf.get("steps") is not None
|
|
68
|
+
if has_steps or wf_type == "stepped":
|
|
69
|
+
return "stepped"
|
|
70
|
+
return wf_type
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def resolve_steps_path(
|
|
74
|
+
workflow_data: dict,
|
|
75
|
+
workflow_dir: Path,
|
|
76
|
+
mode: str | None,
|
|
77
|
+
project_root: Path,
|
|
78
|
+
) -> Path:
|
|
79
|
+
"""Resolve the steps directory path from workflow data.
|
|
80
|
+
|
|
81
|
+
Handles mode-specific paths, relative paths, and absolute paths.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
workflow_data: Parsed workflow YAML
|
|
85
|
+
workflow_dir: Directory containing the workflow.yaml file
|
|
86
|
+
mode: Active mode (create, validate, edit) or None
|
|
87
|
+
project_root: Project root directory
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
Resolved absolute Path to steps directory
|
|
91
|
+
"""
|
|
92
|
+
wf = workflow_data.get("workflow", {})
|
|
93
|
+
|
|
94
|
+
# Try mode-specific path first
|
|
95
|
+
if mode:
|
|
96
|
+
modes = wf.get("modes", {})
|
|
97
|
+
mode_path = modes.get(mode)
|
|
98
|
+
if mode_path and mode_path != "null":
|
|
99
|
+
return _resolve_path(mode_path, workflow_dir, project_root)
|
|
100
|
+
|
|
101
|
+
# Try default mode
|
|
102
|
+
default_mode = wf.get("modes", {}).get("default")
|
|
103
|
+
if default_mode:
|
|
104
|
+
modes = wf.get("modes", {})
|
|
105
|
+
mode_path = modes.get(default_mode)
|
|
106
|
+
if mode_path and mode_path != "null":
|
|
107
|
+
return _resolve_path(mode_path, workflow_dir, project_root)
|
|
108
|
+
|
|
109
|
+
# Fall back to steps.path
|
|
110
|
+
steps_path_str = wf.get("steps", {}).get("path", ".")
|
|
111
|
+
return _resolve_path(steps_path_str, workflow_dir, project_root)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _resolve_path(path_str: str, workflow_dir: Path, project_root: Path) -> Path:
|
|
115
|
+
"""Resolve a path string relative to workflow dir or project root."""
|
|
116
|
+
if path_str.startswith("./"):
|
|
117
|
+
return workflow_dir / path_str[2:]
|
|
118
|
+
elif not Path(path_str).is_absolute():
|
|
119
|
+
return project_root / path_str
|
|
120
|
+
else:
|
|
121
|
+
return Path(path_str)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def count_steps(steps_path: Path) -> int:
|
|
125
|
+
"""Count step files in a directory."""
|
|
126
|
+
if not steps_path.is_dir():
|
|
127
|
+
return 0
|
|
128
|
+
return len([
|
|
129
|
+
f for f in steps_path.iterdir()
|
|
130
|
+
if f.is_file() and re.match(r"step-\d+", f.name) and f.suffix == ".md"
|
|
131
|
+
])
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def find_step_file(steps_path: Path, step_number: int) -> Path | None:
|
|
135
|
+
"""Find step file for a given step number.
|
|
136
|
+
|
|
137
|
+
Handles naming variants: step-01.md, step-01-name.md, step-1-name.md
|
|
138
|
+
"""
|
|
139
|
+
padded = f"{step_number:02d}"
|
|
140
|
+
matches = sorted([
|
|
141
|
+
f for f in steps_path.iterdir()
|
|
142
|
+
if f.is_file()
|
|
143
|
+
and (f.name.startswith(f"step-{padded}") or f.name.startswith(f"step-{step_number}-"))
|
|
144
|
+
and f.suffix == ".md"
|
|
145
|
+
])
|
|
146
|
+
return matches[0] if matches else None
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def strip_frontmatter(content: str) -> str:
|
|
150
|
+
"""Remove YAML frontmatter from step file content."""
|
|
151
|
+
if not content.startswith("---"):
|
|
152
|
+
return content
|
|
153
|
+
end = content.find("---", 3)
|
|
154
|
+
if end == -1:
|
|
155
|
+
return content
|
|
156
|
+
return content[end + 3:].lstrip("\n")
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def parse_session_field(content: str, field: str) -> str:
|
|
160
|
+
"""Extract a field value from session markdown.
|
|
161
|
+
|
|
162
|
+
Matches lines like: - **Field:** value
|
|
163
|
+
"""
|
|
164
|
+
pattern = rf"^- \*\*{re.escape(field)}:\*\*\s*(.+)$"
|
|
165
|
+
match = re.search(pattern, content, re.MULTILINE)
|
|
166
|
+
return match.group(1).strip() if match else ""
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def find_workflow_session(
|
|
170
|
+
session_dir: Path, workflow_name: str | None
|
|
171
|
+
) -> tuple[Path, str] | None:
|
|
172
|
+
"""Find workflow session file and determine workflow name.
|
|
173
|
+
|
|
174
|
+
Args:
|
|
175
|
+
session_dir: Path to .session/ directory
|
|
176
|
+
workflow_name: Explicit workflow name, or None to auto-detect
|
|
177
|
+
|
|
178
|
+
Returns:
|
|
179
|
+
Tuple of (session_path, workflow_name), or None if not found
|
|
180
|
+
"""
|
|
181
|
+
if workflow_name:
|
|
182
|
+
session_file = session_dir / f"{workflow_name}-workflow-session.md"
|
|
183
|
+
if session_file.exists():
|
|
184
|
+
return session_file, workflow_name
|
|
185
|
+
return None
|
|
186
|
+
|
|
187
|
+
# Auto-detect from session directory
|
|
188
|
+
sessions = sorted(session_dir.glob("*-workflow-session.md"))
|
|
189
|
+
if not sessions:
|
|
190
|
+
return None
|
|
191
|
+
|
|
192
|
+
session_file = sessions[0]
|
|
193
|
+
content = session_file.read_text()
|
|
194
|
+
|
|
195
|
+
# Try to extract workflow name from content
|
|
196
|
+
wf_match = re.search(r"^\*\*Workflow:\*\*\s*(.+)$", content, re.MULTILINE)
|
|
197
|
+
if wf_match:
|
|
198
|
+
name = wf_match.group(1).strip()
|
|
199
|
+
else:
|
|
200
|
+
name = session_file.stem.replace("-workflow-session", "")
|
|
201
|
+
|
|
202
|
+
return session_file, name
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def parse_steps_completed(value: str) -> list[int]:
|
|
206
|
+
"""Parse steps completed array from string like '[1, 2, 3]'."""
|
|
207
|
+
if not value or value == "[]":
|
|
208
|
+
return []
|
|
209
|
+
return [int(n) for n in re.findall(r"\d+", value)]
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def format_steps_completed(steps: list[int]) -> str:
|
|
213
|
+
"""Format steps list as bracket notation."""
|
|
214
|
+
if not steps:
|
|
215
|
+
return "[]"
|
|
216
|
+
return "[" + ", ".join(str(s) for s in steps) + "]"
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def find_story_session(session_dir: Path, story_id: str) -> Path | None:
|
|
220
|
+
"""Find a story session file by story ID.
|
|
221
|
+
|
|
222
|
+
Handles various naming patterns: 56-1-session.md, MSSCI-12190-session.md
|
|
223
|
+
Also searches file content for matching Jira/ID fields.
|
|
224
|
+
"""
|
|
225
|
+
# Try direct filename match
|
|
226
|
+
story_id_lower = story_id.lower()
|
|
227
|
+
for pattern in [f"{story_id}-session.md", f"{story_id_lower}-session.md"]:
|
|
228
|
+
candidate = session_dir / pattern
|
|
229
|
+
if candidate.exists():
|
|
230
|
+
return candidate
|
|
231
|
+
|
|
232
|
+
# Search file contents for matching story ID
|
|
233
|
+
for session_file in session_dir.glob("*-session.md"):
|
|
234
|
+
try:
|
|
235
|
+
content = session_file.read_text()
|
|
236
|
+
if f"Jira:** {story_id}" in content or f"ID:** {story_id}" in content:
|
|
237
|
+
return session_file
|
|
238
|
+
except OSError:
|
|
239
|
+
continue
|
|
240
|
+
|
|
241
|
+
return None
|
|
@@ -181,107 +181,3 @@ def get_scale_level_info(level: int) -> dict[str, Any]:
|
|
|
181
181
|
return {"level": level, "scope": "unknown", "stories_min": 0,
|
|
182
182
|
"stories_max": 0, "workflow": "prd", "artifacts": []}
|
|
183
183
|
return SCALE_LEVELS[level].copy()
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
# Phase ownership mapping for TDD workflow
|
|
187
|
-
# Canonical YAML names: setup, red, green, review, finish
|
|
188
|
-
TDD_PHASE_OWNERS: dict[str, str] = {
|
|
189
|
-
"setup": "sm",
|
|
190
|
-
"red": "tea",
|
|
191
|
-
"green": "dev",
|
|
192
|
-
"review": "reviewer",
|
|
193
|
-
"finish": "sm",
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
# Phase ownership mapping for trivial workflow (no TEA)
|
|
197
|
-
# Canonical YAML names: setup, implement, review, finish
|
|
198
|
-
TRIVIAL_PHASE_OWNERS: dict[str, str] = {
|
|
199
|
-
"setup": "sm",
|
|
200
|
-
"implement": "dev",
|
|
201
|
-
"review": "reviewer",
|
|
202
|
-
"finish": "sm",
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
# All workflow phase mappings
|
|
206
|
-
WORKFLOW_PHASES: dict[str, dict[str, str]] = {
|
|
207
|
-
"tdd": TDD_PHASE_OWNERS,
|
|
208
|
-
"trivial": TRIVIAL_PHASE_OWNERS,
|
|
209
|
-
"bdd": TDD_PHASE_OWNERS, # BDD uses same phases as TDD
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
def get_phase_owner(workflow: str, phase: str) -> str:
|
|
214
|
-
"""Get the agent that owns a workflow phase.
|
|
215
|
-
|
|
216
|
-
Args:
|
|
217
|
-
workflow: Workflow name (tdd, trivial, bdd)
|
|
218
|
-
phase: Phase name (setup, red, implement, review, approved)
|
|
219
|
-
|
|
220
|
-
Returns:
|
|
221
|
-
Agent name (sm, tea, dev, reviewer)
|
|
222
|
-
"""
|
|
223
|
-
phases = WORKFLOW_PHASES.get(workflow, TDD_PHASE_OWNERS)
|
|
224
|
-
return phases.get(phase, "sm")
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
def get_workflow_state() -> dict[str, Any]:
|
|
228
|
-
"""Get current workflow state from session files.
|
|
229
|
-
|
|
230
|
-
Scans .session/ directory for active session files and extracts
|
|
231
|
-
workflow state information.
|
|
232
|
-
|
|
233
|
-
Returns:
|
|
234
|
-
Dict with state, story_id, workflow, phase fields
|
|
235
|
-
"""
|
|
236
|
-
from pathlib import Path
|
|
237
|
-
|
|
238
|
-
# Look for session files in .session/
|
|
239
|
-
session_dir = Path(".session")
|
|
240
|
-
if not session_dir.exists():
|
|
241
|
-
return {"state": "EMPTY_BACKLOG_STATE"}
|
|
242
|
-
|
|
243
|
-
# Find session files (pattern: *-session.md)
|
|
244
|
-
session_files = list(session_dir.glob("*-session.md"))
|
|
245
|
-
|
|
246
|
-
# Filter out workflow session files and archived files
|
|
247
|
-
story_sessions = [
|
|
248
|
-
f for f in session_files
|
|
249
|
-
if not f.name.startswith("prd-")
|
|
250
|
-
and not f.name.startswith("architecture-")
|
|
251
|
-
and not f.name.startswith("research-")
|
|
252
|
-
and "workflow" not in f.name.lower()
|
|
253
|
-
]
|
|
254
|
-
|
|
255
|
-
if not story_sessions:
|
|
256
|
-
return {"state": "NEW_WORK_STATE"}
|
|
257
|
-
|
|
258
|
-
# Read the most recent session file
|
|
259
|
-
session_file = max(story_sessions, key=lambda f: f.stat().st_mtime)
|
|
260
|
-
content = session_file.read_text()
|
|
261
|
-
|
|
262
|
-
# Extract fields from markdown format
|
|
263
|
-
# Session files use list format: "- **Field:** value"
|
|
264
|
-
# Also handle direct format: "**Field:** value"
|
|
265
|
-
result: dict[str, Any] = {"state": "IN_PROGRESS_STATE"}
|
|
266
|
-
|
|
267
|
-
for line in content.split("\n"):
|
|
268
|
-
# Strip leading "- " for list items
|
|
269
|
-
stripped = line.lstrip("- ").strip()
|
|
270
|
-
|
|
271
|
-
if stripped.startswith("**Story:**"):
|
|
272
|
-
result["story_id"] = stripped.replace("**Story:**", "").strip()
|
|
273
|
-
elif stripped.startswith("**Jira:**"):
|
|
274
|
-
result["story_id"] = stripped.replace("**Jira:**", "").strip()
|
|
275
|
-
elif stripped.startswith("**ID:**"):
|
|
276
|
-
# Also check **ID:** field (used in Story Details section)
|
|
277
|
-
if "story_id" not in result:
|
|
278
|
-
result["story_id"] = stripped.replace("**ID:**", "").strip()
|
|
279
|
-
elif stripped.startswith("**Type:**"):
|
|
280
|
-
# Workflow section uses **Type:** not **Workflow:**
|
|
281
|
-
result["workflow"] = stripped.replace("**Type:**", "").strip()
|
|
282
|
-
elif stripped.startswith("**Workflow:**"):
|
|
283
|
-
result["workflow"] = stripped.replace("**Workflow:**", "").strip()
|
|
284
|
-
elif stripped.startswith("**Phase:**"):
|
|
285
|
-
result["phase"] = stripped.replace("**Phase:**", "").strip()
|
|
286
|
-
|
|
287
|
-
return result
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Workflow phase ownership and state detection.
|
|
3
|
+
|
|
4
|
+
Maps workflow phases to their owning agents and provides session
|
|
5
|
+
state detection from .session/ files.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Phase ownership mapping for TDD workflow
|
|
12
|
+
# Canonical YAML names: setup, red, green, review, finish
|
|
13
|
+
TDD_PHASE_OWNERS: dict[str, str] = {
|
|
14
|
+
"setup": "sm",
|
|
15
|
+
"red": "tea",
|
|
16
|
+
"green": "dev",
|
|
17
|
+
"review": "reviewer",
|
|
18
|
+
"finish": "sm",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
# Phase ownership mapping for trivial workflow (no TEA)
|
|
22
|
+
# Canonical YAML names: setup, implement, review, finish
|
|
23
|
+
TRIVIAL_PHASE_OWNERS: dict[str, str] = {
|
|
24
|
+
"setup": "sm",
|
|
25
|
+
"implement": "dev",
|
|
26
|
+
"review": "reviewer",
|
|
27
|
+
"finish": "sm",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# All workflow phase mappings
|
|
31
|
+
WORKFLOW_PHASES: dict[str, dict[str, str]] = {
|
|
32
|
+
"tdd": TDD_PHASE_OWNERS,
|
|
33
|
+
"trivial": TRIVIAL_PHASE_OWNERS,
|
|
34
|
+
"bdd": TDD_PHASE_OWNERS, # BDD uses same phases as TDD
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def get_phase_owner(workflow: str, phase: str) -> str:
|
|
39
|
+
"""Get the agent that owns a workflow phase.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
workflow: Workflow name (tdd, trivial, bdd)
|
|
43
|
+
phase: Phase name (setup, red, implement, review, approved)
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
Agent name (sm, tea, dev, reviewer)
|
|
47
|
+
"""
|
|
48
|
+
phases = WORKFLOW_PHASES.get(workflow, TDD_PHASE_OWNERS)
|
|
49
|
+
return phases.get(phase, "sm")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def get_workflow_state() -> dict[str, Any]:
|
|
53
|
+
"""Get current workflow state from session files.
|
|
54
|
+
|
|
55
|
+
Scans .session/ directory for active session files and extracts
|
|
56
|
+
workflow state information.
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
Dict with state, story_id, workflow, phase fields
|
|
60
|
+
"""
|
|
61
|
+
from pathlib import Path
|
|
62
|
+
|
|
63
|
+
# Look for session files in .session/
|
|
64
|
+
session_dir = Path(".session")
|
|
65
|
+
if not session_dir.exists():
|
|
66
|
+
return {"state": "EMPTY_BACKLOG_STATE"}
|
|
67
|
+
|
|
68
|
+
# Find session files (pattern: *-session.md)
|
|
69
|
+
session_files = list(session_dir.glob("*-session.md"))
|
|
70
|
+
|
|
71
|
+
# Filter out workflow session files and archived files
|
|
72
|
+
story_sessions = [
|
|
73
|
+
f for f in session_files
|
|
74
|
+
if not f.name.startswith("prd-")
|
|
75
|
+
and not f.name.startswith("architecture-")
|
|
76
|
+
and not f.name.startswith("research-")
|
|
77
|
+
and "workflow" not in f.name.lower()
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
if not story_sessions:
|
|
81
|
+
return {"state": "NEW_WORK_STATE"}
|
|
82
|
+
|
|
83
|
+
# Read the most recent session file
|
|
84
|
+
session_file = max(story_sessions, key=lambda f: f.stat().st_mtime)
|
|
85
|
+
content = session_file.read_text()
|
|
86
|
+
|
|
87
|
+
# Extract fields from markdown format
|
|
88
|
+
# Session files use list format: "- **Field:** value"
|
|
89
|
+
# Also handle direct format: "**Field:** value"
|
|
90
|
+
result: dict[str, Any] = {"state": "IN_PROGRESS_STATE"}
|
|
91
|
+
|
|
92
|
+
for line in content.split("\n"):
|
|
93
|
+
# Strip leading "- " for list items
|
|
94
|
+
stripped = line.lstrip("- ").strip()
|
|
95
|
+
|
|
96
|
+
if stripped.startswith("**Story:**"):
|
|
97
|
+
result["story_id"] = stripped.replace("**Story:**", "").strip()
|
|
98
|
+
elif stripped.startswith("**Jira:**"):
|
|
99
|
+
result["story_id"] = stripped.replace("**Jira:**", "").strip()
|
|
100
|
+
elif stripped.startswith("**ID:**"):
|
|
101
|
+
# Also check **ID:** field (used in Story Details section)
|
|
102
|
+
if "story_id" not in result:
|
|
103
|
+
result["story_id"] = stripped.replace("**ID:**", "").strip()
|
|
104
|
+
elif stripped.startswith("**Type:**"):
|
|
105
|
+
# Workflow section uses **Type:** not **Workflow:**
|
|
106
|
+
result["workflow"] = stripped.replace("**Type:**", "").strip()
|
|
107
|
+
elif stripped.startswith("**Workflow:**"):
|
|
108
|
+
result["workflow"] = stripped.replace("**Workflow:**", "").strip()
|
|
109
|
+
elif stripped.startswith("**Phase:**"):
|
|
110
|
+
result["phase"] = stripped.replace("**Phase:**", "").strip()
|
|
111
|
+
|
|
112
|
+
return result
|