@pennyfarthing/core 11.2.0 → 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 +1 -1
- 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/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/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/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 +6 -10
- package/pennyfarthing-dist/agents/reviewer.md +8 -2
- package/pennyfarthing-dist/agents/sm-finish.md +18 -1
- package/pennyfarthing-dist/commands/pf-git.md +4 -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/bell-mode.md +1 -1
- package/pennyfarthing-dist/guides/hooks.md +28 -28
- package/pennyfarthing-dist/guides/reflector.md +1 -1
- package/pennyfarthing-dist/guides/tandem-protocol.md +3 -3
- package/pennyfarthing-dist/scripts/core/check-context.sh +2 -0
- package/pennyfarthing-dist/scripts/core/phase-check-start.sh +5 -87
- package/pennyfarthing-dist/scripts/hooks/README.md +5 -5
- 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/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/templates/settings.local.json.template +19 -10
- package/pennyfarthing-dist/workflows/tdd.yaml +11 -2
- package/pennyfarthing_scripts/CLAUDE.md +19 -10
- 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/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/base_panel.py +27 -4
- package/pennyfarthing_scripts/bikerack/changed_panel.py +96 -4
- package/pennyfarthing_scripts/bikerack/context_meter_footer.py +88 -0
- package/pennyfarthing_scripts/bikerack/debug_panel.py +1 -1
- package/pennyfarthing_scripts/bikerack/diffs_panel.py +30 -0
- package/pennyfarthing_scripts/bikerack/events.py +28 -0
- package/pennyfarthing_scripts/bikerack/portrait_resolver.py +139 -0
- package/pennyfarthing_scripts/bikerack/sprint_panel.py +373 -142
- 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 +293 -61
- 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 +5 -0
- 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/__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/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/__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_group/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git_group/__pycache__/cli.cpython-314.pyc +0 -0
- 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 +28 -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 +13 -1
- 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 -432
- 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/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/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_sprint_panel.py +344 -265
- 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/workflow.py +19 -0
- package/pennyfarthing_scripts/welcome_hook.py +3 -149
- 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 +7 -6
- 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_scripts/bikerack/__pycache__/portrait.cpython-314.pyc +0 -0
- 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/git/__pycache__/hooks_installer.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/repos.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/worktree.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/heatmap.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
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -131,6 +131,7 @@ def validate_phased(
|
|
|
131
131
|
return errors, warnings
|
|
132
132
|
|
|
133
133
|
seen_names: set[str] = set()
|
|
134
|
+
next_refs: list[tuple[str, str]] = [] # (phase_name, next_target)
|
|
134
135
|
|
|
135
136
|
for i, phase in enumerate(phases):
|
|
136
137
|
if not isinstance(phase, dict):
|
|
@@ -228,6 +229,24 @@ def validate_phased(
|
|
|
228
229
|
f"Phase '{label}' tandem triggers must be a list"
|
|
229
230
|
)
|
|
230
231
|
|
|
232
|
+
# next: directive (optional, must be string)
|
|
233
|
+
next_target = phase.get("next")
|
|
234
|
+
if next_target is not None:
|
|
235
|
+
if not isinstance(next_target, str):
|
|
236
|
+
errors.append(
|
|
237
|
+
f"Phase '{phase_name or i}' next must be a string"
|
|
238
|
+
)
|
|
239
|
+
elif phase_name:
|
|
240
|
+
next_refs.append((phase_name, next_target))
|
|
241
|
+
|
|
242
|
+
# Cross-validate next: references point to existing phase names
|
|
243
|
+
for source_phase, target_phase in next_refs:
|
|
244
|
+
if target_phase not in seen_names:
|
|
245
|
+
errors.append(
|
|
246
|
+
f"Phase '{source_phase}' next references unknown phase: "
|
|
247
|
+
f"'{target_phase}'"
|
|
248
|
+
)
|
|
249
|
+
|
|
231
250
|
return errors, warnings
|
|
232
251
|
|
|
233
252
|
|
|
@@ -1,156 +1,10 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
1
|
"""
|
|
3
|
-
|
|
2
|
+
Backward-compatibility shim — welcome hook moved to hooks/session_start.py.
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
For CLI: Displays ASCII art of a penny-farthing bicycle
|
|
8
|
-
For Cyclist: Sends WebSocket message to display logo and welcome
|
|
9
|
-
|
|
10
|
-
Called by Claude Code SessionStart hook.
|
|
11
|
-
|
|
12
|
-
Story: MSSCI-12409 - Hook consistency and WheelHub consolidation
|
|
4
|
+
This file will be removed in a future version.
|
|
13
5
|
"""
|
|
14
6
|
|
|
15
|
-
import
|
|
16
|
-
import os
|
|
17
|
-
import sys
|
|
18
|
-
from pathlib import Path
|
|
19
|
-
|
|
20
|
-
# Add parent directory to path for imports
|
|
21
|
-
sys.path.insert(0, str(Path(__file__).parent))
|
|
22
|
-
|
|
23
|
-
from hooks import (
|
|
24
|
-
find_project_root,
|
|
25
|
-
is_cyclist_running,
|
|
26
|
-
load_settings,
|
|
27
|
-
send_to_cyclist,
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
# Once-per-session guard
|
|
31
|
-
_welcome_shown_file: Path | None = None
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def get_welcome_lock_path(project_root: Path) -> Path:
|
|
35
|
-
"""Get path to welcome shown lock file."""
|
|
36
|
-
session_id = os.environ.get("CLAUDE_SESSION_ID", str(os.getpid()))
|
|
37
|
-
session_dir = project_root / ".session"
|
|
38
|
-
session_dir.mkdir(parents=True, exist_ok=True)
|
|
39
|
-
return session_dir / f".welcome-shown-{session_id}"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
def was_welcome_shown(project_root: Path) -> bool:
|
|
43
|
-
"""Check if welcome was already shown for this session."""
|
|
44
|
-
lock_path = get_welcome_lock_path(project_root)
|
|
45
|
-
return lock_path.exists()
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def mark_welcome_shown(project_root: Path) -> None:
|
|
49
|
-
"""Mark welcome as shown for this session."""
|
|
50
|
-
lock_path = get_welcome_lock_path(project_root)
|
|
51
|
-
lock_path.touch()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def get_project_name(project_root: Path) -> str:
|
|
55
|
-
"""Get project name from package.json or directory name."""
|
|
56
|
-
package_json = project_root / "package.json"
|
|
57
|
-
if package_json.exists():
|
|
58
|
-
try:
|
|
59
|
-
with open(package_json) as f:
|
|
60
|
-
data = json.load(f)
|
|
61
|
-
name = data.get("name")
|
|
62
|
-
if name:
|
|
63
|
-
return name
|
|
64
|
-
except (json.JSONDecodeError, OSError):
|
|
65
|
-
pass
|
|
66
|
-
|
|
67
|
-
return project_root.name
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def get_theme(project_root: Path) -> str | None:
|
|
71
|
-
"""Get current theme from settings."""
|
|
72
|
-
settings = load_settings(project_root)
|
|
73
|
-
return settings.theme
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def display_cli_welcome(project_name: str, theme: str | None) -> None:
|
|
77
|
-
"""Display ASCII art welcome for CLI mode."""
|
|
78
|
-
print("""
|
|
79
|
-
___
|
|
80
|
-
/ \\
|
|
81
|
-
| | Welcome to
|
|
82
|
-
| | ╔═══════════════════════════════════╗
|
|
83
|
-
\\___/ ║ ╔═╗╔═╗╔╗╔╔╗╔╦═╗╔═╗╔═╗╔═╗╦╔═╗ ║
|
|
84
|
-
║ ║ ╠═╝║╣ ║║║║║║ ╠╣ ╠═╣╠╦╝ ║ ╠═╣ ║
|
|
85
|
-
║ ║ ╩ ╚═╝╝╚╝╝╚╝╩ ╩ ╩╩╚═ ╩ ╩ ╩ ║
|
|
86
|
-
╔═╩═╗ ╚═══════════════════════════════════╝
|
|
87
|
-
/ \\
|
|
88
|
-
│ O │ Agent-powered development with style
|
|
89
|
-
\\ /
|
|
90
|
-
╚═══╝
|
|
91
|
-
""")
|
|
92
|
-
|
|
93
|
-
if project_name:
|
|
94
|
-
print(f" Project: {project_name}")
|
|
95
|
-
if theme:
|
|
96
|
-
print(f" Theme: {theme}")
|
|
97
|
-
print()
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def send_cyclist_welcome(project_root: Path, project_name: str, theme: str | None) -> None:
|
|
101
|
-
"""Send welcome message to Cyclist via WebSocket API."""
|
|
102
|
-
try:
|
|
103
|
-
send_to_cyclist(
|
|
104
|
-
endpoint="/api/welcome",
|
|
105
|
-
data={
|
|
106
|
-
"project": project_name or "",
|
|
107
|
-
"theme": theme or "",
|
|
108
|
-
},
|
|
109
|
-
project_root=project_root,
|
|
110
|
-
timeout=5,
|
|
111
|
-
)
|
|
112
|
-
except Exception:
|
|
113
|
-
# Ignore errors - don't block hook
|
|
114
|
-
pass
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
def main() -> None:
|
|
118
|
-
"""Main entry point for SessionStart welcome hook."""
|
|
119
|
-
try:
|
|
120
|
-
# Read and discard stdin (required by hook protocol)
|
|
121
|
-
sys.stdin.read()
|
|
122
|
-
|
|
123
|
-
# Find project root
|
|
124
|
-
project_root = find_project_root()
|
|
125
|
-
if not project_root:
|
|
126
|
-
sys.exit(0)
|
|
127
|
-
|
|
128
|
-
# Check if welcome was already shown for this session
|
|
129
|
-
if was_welcome_shown(project_root):
|
|
130
|
-
sys.exit(0)
|
|
131
|
-
|
|
132
|
-
# Mark welcome as shown
|
|
133
|
-
mark_welcome_shown(project_root)
|
|
134
|
-
|
|
135
|
-
# Get project info
|
|
136
|
-
project_name = get_project_name(project_root)
|
|
137
|
-
theme = get_theme(project_root)
|
|
138
|
-
|
|
139
|
-
# Check if running in Cyclist
|
|
140
|
-
if is_cyclist_running(project_root):
|
|
141
|
-
# Send welcome via WebSocket API
|
|
142
|
-
send_cyclist_welcome(project_root, project_name, theme)
|
|
143
|
-
else:
|
|
144
|
-
# CLI mode - display ASCII art
|
|
145
|
-
display_cli_welcome(project_name, theme)
|
|
146
|
-
|
|
147
|
-
sys.exit(0)
|
|
148
|
-
|
|
149
|
-
except Exception as e:
|
|
150
|
-
# On error, exit silently
|
|
151
|
-
print(f"[welcome-hook] Error: {e}", file=sys.stderr)
|
|
152
|
-
sys.exit(0)
|
|
153
|
-
|
|
7
|
+
from pennyfarthing_scripts.hooks.session_start import main # noqa: F401
|
|
154
8
|
|
|
155
9
|
if __name__ == "__main__":
|
|
156
10
|
main()
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -90,17 +90,18 @@ def workflow_phase_check(workflow_name: str, phase: str):
|
|
|
90
90
|
@workflow.command("handoff")
|
|
91
91
|
@click.argument("next_agent")
|
|
92
92
|
def workflow_handoff(next_agent: str):
|
|
93
|
-
"""Emit
|
|
93
|
+
"""Emit an environment-aware handoff marker.
|
|
94
|
+
|
|
95
|
+
Delegates to generate_marker() which detects Cyclist, relay mode,
|
|
96
|
+
and context usage to choose the appropriate marker type.
|
|
94
97
|
|
|
95
98
|
\b
|
|
96
99
|
Arguments:
|
|
97
100
|
NEXT_AGENT - The agent to hand off to (tea, dev, reviewer, etc.)
|
|
98
101
|
"""
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
click.echo(
|
|
102
|
-
click.echo(f' fallback: "Run `/{next_agent}` to continue"')
|
|
103
|
-
click.echo("---")
|
|
102
|
+
from pennyfarthing_scripts.handoff.marker import generate_marker
|
|
103
|
+
|
|
104
|
+
click.echo(generate_marker(next_agent))
|
|
104
105
|
|
|
105
106
|
|
|
106
107
|
# ---------------------------------------------------------------------------
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Phase-scoped Team Lifecycle for Story 86-10.
|
|
3
|
+
|
|
4
|
+
Manages the lifecycle of native Agent Teams within workflow phases.
|
|
5
|
+
When a workflow phase has a `team:` config block, the lead agent creates
|
|
6
|
+
a team at phase start, spawns teammates, and cleans up before handoff.
|
|
7
|
+
|
|
8
|
+
Python port of packages/core/dist/workflow/team-lifecycle.js.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from datetime import datetime, timezone
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# =============================================================================
|
|
19
|
+
# In-memory registries
|
|
20
|
+
# =============================================================================
|
|
21
|
+
|
|
22
|
+
_active_teams: dict[str, dict[str, Any]] = {}
|
|
23
|
+
"""Active teams keyed by story_id."""
|
|
24
|
+
|
|
25
|
+
_sidecar_locks: dict[str, dict[str, Any]] = {}
|
|
26
|
+
"""Sidecar locks keyed by file path."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _reset_for_testing() -> None:
|
|
30
|
+
"""Reset all in-memory state. For testing only."""
|
|
31
|
+
_active_teams.clear()
|
|
32
|
+
_sidecar_locks.clear()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
async def create_team(
|
|
36
|
+
phase: dict[str, Any],
|
|
37
|
+
story_id: str,
|
|
38
|
+
adapter: Any | None = None,
|
|
39
|
+
) -> dict[str, Any]:
|
|
40
|
+
"""Create a phase-scoped team.
|
|
41
|
+
|
|
42
|
+
If phase has no team config, returns success with no handle (no-op).
|
|
43
|
+
If phase has team config, creates team and returns handle.
|
|
44
|
+
"""
|
|
45
|
+
if not phase.get("team"):
|
|
46
|
+
return {"success": True}
|
|
47
|
+
|
|
48
|
+
team_name = f"{story_id}-{phase['name']}"
|
|
49
|
+
|
|
50
|
+
# Clean up existing team for same story
|
|
51
|
+
existing = _active_teams.get(story_id)
|
|
52
|
+
if existing and adapter:
|
|
53
|
+
try:
|
|
54
|
+
await adapter.delete_team(existing["teamName"])
|
|
55
|
+
except Exception:
|
|
56
|
+
pass
|
|
57
|
+
del _active_teams[story_id]
|
|
58
|
+
|
|
59
|
+
handle: dict[str, Any] = {
|
|
60
|
+
"teamName": team_name,
|
|
61
|
+
"storyId": story_id,
|
|
62
|
+
"phase": phase["name"],
|
|
63
|
+
"teammates": [],
|
|
64
|
+
"createdAt": datetime.now(timezone.utc).isoformat(),
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if adapter:
|
|
68
|
+
try:
|
|
69
|
+
await adapter.create_team({"teamName": team_name})
|
|
70
|
+
except Exception as exc:
|
|
71
|
+
return {"success": False, "error": str(exc)}
|
|
72
|
+
|
|
73
|
+
_active_teams[story_id] = handle
|
|
74
|
+
return {"success": True, "data": handle}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
async def spawn_teammates(
|
|
78
|
+
handle: dict[str, Any],
|
|
79
|
+
config: dict[str, Any],
|
|
80
|
+
story_id: str,
|
|
81
|
+
phase: dict[str, Any],
|
|
82
|
+
adapter: Any | None = None,
|
|
83
|
+
) -> dict[str, Any]:
|
|
84
|
+
"""Spawn all teammates for a team based on workflow YAML config."""
|
|
85
|
+
teammates: list[dict[str, Any]] = []
|
|
86
|
+
|
|
87
|
+
for member in config["teammates"]:
|
|
88
|
+
teammate: dict[str, Any] = {
|
|
89
|
+
"agent": member["agent"],
|
|
90
|
+
"task": member["task"],
|
|
91
|
+
"status": "spawned",
|
|
92
|
+
}
|
|
93
|
+
if adapter:
|
|
94
|
+
try:
|
|
95
|
+
await adapter.spawn_teammate({
|
|
96
|
+
"teamName": handle["teamName"],
|
|
97
|
+
"agent": member["agent"],
|
|
98
|
+
"prompt": f'pf agent start "{member["agent"]}"',
|
|
99
|
+
"model": config.get("model"),
|
|
100
|
+
})
|
|
101
|
+
except Exception:
|
|
102
|
+
teammate["status"] = "crashed"
|
|
103
|
+
teammates.append(teammate)
|
|
104
|
+
|
|
105
|
+
handle["teammates"] = teammates
|
|
106
|
+
|
|
107
|
+
# Update registry
|
|
108
|
+
if handle.get("storyId") in _active_teams:
|
|
109
|
+
_active_teams[handle["storyId"]] = handle
|
|
110
|
+
|
|
111
|
+
return {"success": True, "data": teammates}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
async def shutdown_all_teammates(
|
|
115
|
+
handle: dict[str, Any],
|
|
116
|
+
adapter: Any | None = None,
|
|
117
|
+
) -> dict[str, Any]:
|
|
118
|
+
"""Shut down all active teammates in a team."""
|
|
119
|
+
shutdown_count = 0
|
|
120
|
+
|
|
121
|
+
for teammate in handle["teammates"]:
|
|
122
|
+
if teammate["status"] in ("shutdown", "crashed"):
|
|
123
|
+
continue
|
|
124
|
+
if adapter:
|
|
125
|
+
try:
|
|
126
|
+
await adapter.shutdown_teammate({
|
|
127
|
+
"teamName": handle["teamName"],
|
|
128
|
+
"agent": teammate["agent"],
|
|
129
|
+
})
|
|
130
|
+
except Exception:
|
|
131
|
+
pass # Graceful degradation — swallow adapter errors
|
|
132
|
+
teammate["status"] = "shutdown"
|
|
133
|
+
shutdown_count += 1
|
|
134
|
+
|
|
135
|
+
return {"success": True, "data": {"shutdownCount": shutdown_count}}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
async def cleanup_team(
|
|
139
|
+
handle: dict[str, Any],
|
|
140
|
+
adapter: Any | None = None,
|
|
141
|
+
) -> dict[str, Any]:
|
|
142
|
+
"""Clean up a team entirely (TeamDelete). Must run before pf handoff."""
|
|
143
|
+
if adapter:
|
|
144
|
+
try:
|
|
145
|
+
await adapter.delete_team(handle["teamName"])
|
|
146
|
+
except Exception:
|
|
147
|
+
pass
|
|
148
|
+
|
|
149
|
+
_active_teams.pop(handle.get("storyId", ""), None)
|
|
150
|
+
return {"success": True, "data": {"cleaned": True}}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def check_gate_on_task_completed(
|
|
154
|
+
handle: dict[str, Any],
|
|
155
|
+
phase: dict[str, Any],
|
|
156
|
+
) -> dict[str, Any]:
|
|
157
|
+
"""Check gate condition when a TaskCompleted event fires."""
|
|
158
|
+
if not phase.get("gate"):
|
|
159
|
+
return {"passed": True, "gate": "none"}
|
|
160
|
+
|
|
161
|
+
gate_type = phase["gate"].get("type", "unknown")
|
|
162
|
+
has_active = any(t["status"] == "active" for t in handle["teammates"])
|
|
163
|
+
|
|
164
|
+
if has_active:
|
|
165
|
+
return {"passed": False, "gate": gate_type, "reason": "Teammates still active"}
|
|
166
|
+
|
|
167
|
+
return {"passed": True, "gate": gate_type}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def check_gate_on_teammate_idle(
|
|
171
|
+
handle: dict[str, Any],
|
|
172
|
+
teammate: dict[str, Any],
|
|
173
|
+
phase: dict[str, Any],
|
|
174
|
+
) -> dict[str, Any]:
|
|
175
|
+
"""Check gate condition when a TeammateIdle event fires."""
|
|
176
|
+
if not phase.get("gate"):
|
|
177
|
+
return {"passed": True, "gate": "none"}
|
|
178
|
+
|
|
179
|
+
gate_type = phase["gate"].get("type", "unknown")
|
|
180
|
+
|
|
181
|
+
if teammate["status"] == "crashed":
|
|
182
|
+
return {"passed": False, "gate": gate_type, "reason": "Teammate crashed"}
|
|
183
|
+
|
|
184
|
+
return {"passed": True, "gate": gate_type}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def generate_team_summary(handle: dict[str, Any]) -> dict[str, Any]:
|
|
188
|
+
"""Generate a team activity summary for the session file audit trail."""
|
|
189
|
+
return {
|
|
190
|
+
"teamName": handle["teamName"],
|
|
191
|
+
"storyId": handle["storyId"],
|
|
192
|
+
"phase": handle["phase"],
|
|
193
|
+
"members": [
|
|
194
|
+
{"agent": t["agent"], "status": t["status"], "task": t["task"]}
|
|
195
|
+
for t in handle["teammates"]
|
|
196
|
+
],
|
|
197
|
+
"cleanShutdown": all(t["status"] == "shutdown" for t in handle["teammates"]),
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def acquire_sidecar_lock(
|
|
202
|
+
file_path: str,
|
|
203
|
+
story_id: str,
|
|
204
|
+
timeout: int = 5000,
|
|
205
|
+
) -> dict[str, Any]:
|
|
206
|
+
"""Acquire an exclusive lock for sidecar file writing."""
|
|
207
|
+
existing = _sidecar_locks.get(file_path)
|
|
208
|
+
if existing:
|
|
209
|
+
if existing["storyId"] == story_id:
|
|
210
|
+
return {"success": True, "data": existing}
|
|
211
|
+
return {"success": False, "error": f"Lock held by story {existing['storyId']}"}
|
|
212
|
+
|
|
213
|
+
lock: dict[str, Any] = {
|
|
214
|
+
"lockPath": f"{file_path}.lock",
|
|
215
|
+
"storyId": story_id,
|
|
216
|
+
"acquiredAt": datetime.now(timezone.utc).isoformat(),
|
|
217
|
+
}
|
|
218
|
+
_sidecar_locks[file_path] = lock
|
|
219
|
+
return {"success": True, "data": lock}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def release_sidecar_lock(lock: dict[str, Any]) -> dict[str, Any]:
|
|
223
|
+
"""Release a sidecar file lock."""
|
|
224
|
+
for path, held in list(_sidecar_locks.items()):
|
|
225
|
+
if held["lockPath"] == lock["lockPath"]:
|
|
226
|
+
del _sidecar_locks[path]
|
|
227
|
+
break
|
|
228
|
+
return {"success": True}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
def get_active_team(story_id: str) -> dict[str, Any] | None:
|
|
232
|
+
"""Get the active team for a story, if any."""
|
|
233
|
+
return _active_teams.get(story_id)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
def update_session_with_summary(
|
|
237
|
+
session_path: str | Path,
|
|
238
|
+
summary: dict[str, Any],
|
|
239
|
+
) -> dict[str, Any]:
|
|
240
|
+
"""Write team activity summary to session file for audit trail."""
|
|
241
|
+
path = Path(session_path)
|
|
242
|
+
content = path.read_text() if path.exists() else ""
|
|
243
|
+
|
|
244
|
+
lines = [
|
|
245
|
+
"\n## Team Activity Summary\n",
|
|
246
|
+
f"**Team:** {summary['teamName']}",
|
|
247
|
+
f"**Phase:** {summary['phase']}",
|
|
248
|
+
f"**Clean Shutdown:** {'Yes' if summary.get('cleanShutdown') else 'No'}\n",
|
|
249
|
+
"| Agent | Status | Task |",
|
|
250
|
+
"|-------|--------|------|",
|
|
251
|
+
]
|
|
252
|
+
for member in summary.get("members", []):
|
|
253
|
+
lines.append(f"| {member['agent']} | {member['status']} | {member['task']} |")
|
|
254
|
+
|
|
255
|
+
content += "\n".join(lines) + "\n"
|
|
256
|
+
path.write_text(content)
|
|
257
|
+
return {"success": True}
|