hungry-ghost-hive 0.48.0 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/base-agent.d.ts +11 -11
- package/dist/agents/base-agent.d.ts.map +1 -1
- package/dist/agents/base-agent.js +25 -25
- package/dist/agents/base-agent.js.map +1 -1
- package/dist/agents/base-agent.test.js +2 -1
- package/dist/agents/base-agent.test.js.map +1 -1
- package/dist/agents/intermediate.d.ts +2 -0
- package/dist/agents/intermediate.d.ts.map +1 -1
- package/dist/agents/intermediate.js +25 -18
- package/dist/agents/intermediate.js.map +1 -1
- package/dist/agents/junior.d.ts +2 -0
- package/dist/agents/junior.d.ts.map +1 -1
- package/dist/agents/junior.js +25 -18
- package/dist/agents/junior.js.map +1 -1
- package/dist/agents/qa.d.ts +2 -0
- package/dist/agents/qa.d.ts.map +1 -1
- package/dist/agents/qa.js +47 -38
- package/dist/agents/qa.js.map +1 -1
- package/dist/agents/senior.d.ts +2 -0
- package/dist/agents/senior.d.ts.map +1 -1
- package/dist/agents/senior.js +40 -27
- package/dist/agents/senior.js.map +1 -1
- package/dist/agents/tech-lead.d.ts +2 -0
- package/dist/agents/tech-lead.d.ts.map +1 -1
- package/dist/agents/tech-lead.js +37 -31
- package/dist/agents/tech-lead.js.map +1 -1
- package/dist/cli/commands/add-repo.js +2 -2
- package/dist/cli/commands/add-repo.js.map +1 -1
- package/dist/cli/commands/add-repo.test.js +1 -1
- package/dist/cli/commands/add-repo.test.js.map +1 -1
- package/dist/cli/commands/agents.d.ts.map +1 -1
- package/dist/cli/commands/agents.js +12 -10
- package/dist/cli/commands/agents.js.map +1 -1
- package/dist/cli/commands/agents.test.js +7 -7
- package/dist/cli/commands/agents.test.js.map +1 -1
- package/dist/cli/commands/approach.js +2 -2
- package/dist/cli/commands/approach.js.map +1 -1
- package/dist/cli/commands/approvals.js +7 -7
- package/dist/cli/commands/approvals.js.map +1 -1
- package/dist/cli/commands/approvals.test.js +8 -8
- package/dist/cli/commands/approvals.test.js.map +1 -1
- package/dist/cli/commands/assign.js +4 -4
- package/dist/cli/commands/assign.js.map +1 -1
- package/dist/cli/commands/assign.test.js +18 -16
- package/dist/cli/commands/assign.test.js.map +1 -1
- package/dist/cli/commands/cleanup.d.ts.map +1 -1
- package/dist/cli/commands/cleanup.js +8 -8
- package/dist/cli/commands/cleanup.js.map +1 -1
- package/dist/cli/commands/cleanup.test.js +5 -1
- package/dist/cli/commands/cleanup.test.js.map +1 -1
- package/dist/cli/commands/escalations.js +9 -7
- package/dist/cli/commands/escalations.js.map +1 -1
- package/dist/cli/commands/escalations.test.js +2 -2
- package/dist/cli/commands/escalations.test.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +48 -5
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/init.test.js +4 -0
- package/dist/cli/commands/init.test.js.map +1 -1
- package/dist/cli/commands/manager/agent-monitoring.d.ts +2 -2
- package/dist/cli/commands/manager/agent-monitoring.d.ts.map +1 -1
- package/dist/cli/commands/manager/agent-monitoring.js +1 -1
- package/dist/cli/commands/manager/agent-monitoring.js.map +1 -1
- package/dist/cli/commands/manager/auditor-lifecycle.js +3 -3
- package/dist/cli/commands/manager/auditor-lifecycle.js.map +1 -1
- package/dist/cli/commands/manager/auditor-lifecycle.test.js +21 -14
- package/dist/cli/commands/manager/auditor-lifecycle.test.js.map +1 -1
- package/dist/cli/commands/manager/auto-reject-comment-only-reviews.test.js +28 -23
- package/dist/cli/commands/manager/auto-reject-comment-only-reviews.test.js.map +1 -1
- package/dist/cli/commands/manager/escalation-handler.d.ts +2 -2
- package/dist/cli/commands/manager/escalation-handler.d.ts.map +1 -1
- package/dist/cli/commands/manager/escalation-handler.js +11 -10
- package/dist/cli/commands/manager/escalation-handler.js.map +1 -1
- package/dist/cli/commands/manager/escalation-handler.test.js +8 -8
- package/dist/cli/commands/manager/escalation-handler.test.js.map +1 -1
- package/dist/cli/commands/manager/feature-sign-off.js +7 -7
- package/dist/cli/commands/manager/feature-sign-off.js.map +1 -1
- package/dist/cli/commands/manager/feature-sign-off.test.js +40 -31
- package/dist/cli/commands/manager/feature-sign-off.test.js.map +1 -1
- package/dist/cli/commands/manager/feature-test-result.d.ts.map +1 -1
- package/dist/cli/commands/manager/feature-test-result.js +12 -13
- package/dist/cli/commands/manager/feature-test-result.js.map +1 -1
- package/dist/cli/commands/manager/handoff-recovery.d.ts.map +1 -1
- package/dist/cli/commands/manager/handoff-recovery.js +14 -15
- package/dist/cli/commands/manager/handoff-recovery.js.map +1 -1
- package/dist/cli/commands/manager/index.d.ts.map +1 -1
- package/dist/cli/commands/manager/index.js +26 -26
- package/dist/cli/commands/manager/index.js.map +1 -1
- package/dist/cli/commands/manager/index.test.js +3 -3
- package/dist/cli/commands/manager/index.test.js.map +1 -1
- package/dist/cli/commands/manager/merged-story-cleanup.d.ts +2 -2
- package/dist/cli/commands/manager/merged-story-cleanup.d.ts.map +1 -1
- package/dist/cli/commands/manager/merged-story-cleanup.js +6 -7
- package/dist/cli/commands/manager/merged-story-cleanup.js.map +1 -1
- package/dist/cli/commands/manager/merged-story-cleanup.test.js +27 -18
- package/dist/cli/commands/manager/merged-story-cleanup.test.js.map +1 -1
- package/dist/cli/commands/manager/pr-sync-orchestrator.d.ts.map +1 -1
- package/dist/cli/commands/manager/pr-sync-orchestrator.js +46 -38
- package/dist/cli/commands/manager/pr-sync-orchestrator.js.map +1 -1
- package/dist/cli/commands/manager/qa-review-handler.d.ts.map +1 -1
- package/dist/cli/commands/manager/qa-review-handler.js +25 -22
- package/dist/cli/commands/manager/qa-review-handler.js.map +1 -1
- package/dist/cli/commands/manager/spin-down.d.ts.map +1 -1
- package/dist/cli/commands/manager/spin-down.js +23 -19
- package/dist/cli/commands/manager/spin-down.js.map +1 -1
- package/dist/cli/commands/manager/stale-escalations.d.ts +2 -3
- package/dist/cli/commands/manager/stale-escalations.d.ts.map +1 -1
- package/dist/cli/commands/manager/stale-escalations.js.map +1 -1
- package/dist/cli/commands/manager/stuck-story-helpers.js +8 -8
- package/dist/cli/commands/manager/stuck-story-helpers.js.map +1 -1
- package/dist/cli/commands/manager/stuck-story-processor.d.ts +2 -2
- package/dist/cli/commands/manager/stuck-story-processor.d.ts.map +1 -1
- package/dist/cli/commands/manager/stuck-story-processor.js +23 -22
- package/dist/cli/commands/manager/stuck-story-processor.js.map +1 -1
- package/dist/cli/commands/manager/tech-lead-lifecycle.js +6 -6
- package/dist/cli/commands/manager/tech-lead-lifecycle.js.map +1 -1
- package/dist/cli/commands/manager/types.d.ts +2 -3
- package/dist/cli/commands/manager/types.d.ts.map +1 -1
- package/dist/cli/commands/manager/types.js.map +1 -1
- package/dist/cli/commands/msg.test.js +2 -2
- package/dist/cli/commands/msg.test.js.map +1 -1
- package/dist/cli/commands/my-stories.d.ts.map +1 -1
- package/dist/cli/commands/my-stories.js +17 -18
- package/dist/cli/commands/my-stories.js.map +1 -1
- package/dist/cli/commands/my-stories.test.js +2 -2
- package/dist/cli/commands/my-stories.test.js.map +1 -1
- package/dist/cli/commands/nuke.test.js +1 -1
- package/dist/cli/commands/nuke.test.js.map +1 -1
- package/dist/cli/commands/pr.js +32 -32
- package/dist/cli/commands/pr.js.map +1 -1
- package/dist/cli/commands/pr.test.js +10 -6
- package/dist/cli/commands/pr.test.js.map +1 -1
- package/dist/cli/commands/progress.d.ts.map +1 -1
- package/dist/cli/commands/progress.js +4 -5
- package/dist/cli/commands/progress.js.map +1 -1
- package/dist/cli/commands/progress.test.js +1 -1
- package/dist/cli/commands/progress.test.js.map +1 -1
- package/dist/cli/commands/req-headless.test.d.ts +2 -0
- package/dist/cli/commands/req-headless.test.d.ts.map +1 -0
- package/dist/cli/commands/req-headless.test.js +128 -0
- package/dist/cli/commands/req-headless.test.js.map +1 -0
- package/dist/cli/commands/req-spawn.test.js +5 -1
- package/dist/cli/commands/req-spawn.test.js.map +1 -1
- package/dist/cli/commands/req.d.ts.map +1 -1
- package/dist/cli/commands/req.js +13 -14
- package/dist/cli/commands/req.js.map +1 -1
- package/dist/cli/commands/resume.d.ts.map +1 -1
- package/dist/cli/commands/resume.js +7 -8
- package/dist/cli/commands/resume.js.map +1 -1
- package/dist/cli/commands/resume.test.js +1 -1
- package/dist/cli/commands/resume.test.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +42 -40
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/status.test.js +1 -1
- package/dist/cli/commands/status.test.js.map +1 -1
- package/dist/cli/commands/stories.js +9 -9
- package/dist/cli/commands/stories.js.map +1 -1
- package/dist/cli/commands/stories.test.js +2 -2
- package/dist/cli/commands/stories.test.js.map +1 -1
- package/dist/cli/commands/teams.js +11 -11
- package/dist/cli/commands/teams.js.map +1 -1
- package/dist/cli/commands/teams.test.js +2 -2
- package/dist/cli/commands/teams.test.js.map +1 -1
- package/dist/cli/dashboard/index.d.ts +2 -2
- package/dist/cli/dashboard/index.d.ts.map +1 -1
- package/dist/cli/dashboard/index.js +29 -20
- package/dist/cli/dashboard/index.js.map +1 -1
- package/dist/cli/dashboard/index.test.js +34 -32
- package/dist/cli/dashboard/index.test.js.map +1 -1
- package/dist/cli/dashboard/panels/activity.d.ts +3 -3
- package/dist/cli/dashboard/panels/activity.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/activity.js +1 -1
- package/dist/cli/dashboard/panels/activity.js.map +1 -1
- package/dist/cli/dashboard/panels/agents.d.ts +3 -3
- package/dist/cli/dashboard/panels/agents.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/agents.js +2 -2
- package/dist/cli/dashboard/panels/agents.js.map +1 -1
- package/dist/cli/dashboard/panels/escalations.d.ts +3 -3
- package/dist/cli/dashboard/panels/escalations.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/escalations.js +1 -1
- package/dist/cli/dashboard/panels/escalations.js.map +1 -1
- package/dist/cli/dashboard/panels/merge-queue.d.ts +3 -3
- package/dist/cli/dashboard/panels/merge-queue.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/merge-queue.js +1 -1
- package/dist/cli/dashboard/panels/merge-queue.js.map +1 -1
- package/dist/cli/dashboard/panels/pipeline.d.ts +3 -3
- package/dist/cli/dashboard/panels/pipeline.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/pipeline.js +1 -1
- package/dist/cli/dashboard/panels/pipeline.js.map +1 -1
- package/dist/config/schema.d.ts +85 -82
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +1 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/connectors/project-management/operations.d.ts +7 -7
- package/dist/connectors/project-management/operations.d.ts.map +1 -1
- package/dist/connectors/project-management/operations.js +2 -3
- package/dist/connectors/project-management/operations.js.map +1 -1
- package/dist/context-files/index.test.js +1 -0
- package/dist/context-files/index.test.js.map +1 -1
- package/dist/db/client.d.ts +6 -0
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +7 -0
- package/dist/db/client.js.map +1 -1
- package/dist/db/postgres-provider.d.ts +43 -0
- package/dist/db/postgres-provider.d.ts.map +1 -0
- package/dist/db/postgres-provider.integration.test.d.ts +2 -0
- package/dist/db/postgres-provider.integration.test.d.ts.map +1 -0
- package/dist/db/postgres-provider.integration.test.js +399 -0
- package/dist/db/postgres-provider.integration.test.js.map +1 -0
- package/dist/db/postgres-provider.js +315 -0
- package/dist/db/postgres-provider.js.map +1 -0
- package/dist/db/postgres-provider.test.d.ts +2 -0
- package/dist/db/postgres-provider.test.d.ts.map +1 -0
- package/dist/db/postgres-provider.test.js +72 -0
- package/dist/db/postgres-provider.test.js.map +1 -0
- package/dist/db/provider.d.ts +59 -0
- package/dist/db/provider.d.ts.map +1 -0
- package/dist/db/provider.js +121 -0
- package/dist/db/provider.js.map +1 -0
- package/dist/db/provider.test.d.ts +2 -0
- package/dist/db/provider.test.d.ts.map +1 -0
- package/dist/db/provider.test.js +226 -0
- package/dist/db/provider.test.js.map +1 -0
- package/dist/db/queries/agents.d.ts +13 -13
- package/dist/db/queries/agents.d.ts.map +1 -1
- package/dist/db/queries/agents.js +27 -28
- package/dist/db/queries/agents.js.map +1 -1
- package/dist/db/queries/agents.test.js +113 -111
- package/dist/db/queries/agents.test.js.map +1 -1
- package/dist/db/queries/escalations.d.ts +16 -16
- package/dist/db/queries/escalations.d.ts.map +1 -1
- package/dist/db/queries/escalations.js +34 -35
- package/dist/db/queries/escalations.js.map +1 -1
- package/dist/db/queries/escalations.test.js +133 -131
- package/dist/db/queries/escalations.test.js.map +1 -1
- package/dist/db/queries/heartbeat.d.ts +5 -5
- package/dist/db/queries/heartbeat.d.ts.map +1 -1
- package/dist/db/queries/heartbeat.js +7 -23
- package/dist/db/queries/heartbeat.js.map +1 -1
- package/dist/db/queries/heartbeat.test.js +76 -76
- package/dist/db/queries/heartbeat.test.js.map +1 -1
- package/dist/db/queries/integration-sync.d.ts +7 -7
- package/dist/db/queries/integration-sync.d.ts.map +1 -1
- package/dist/db/queries/integration-sync.js +13 -14
- package/dist/db/queries/integration-sync.js.map +1 -1
- package/dist/db/queries/logs.d.ts +10 -10
- package/dist/db/queries/logs.d.ts.map +1 -1
- package/dist/db/queries/logs.js +44 -42
- package/dist/db/queries/logs.js.map +1 -1
- package/dist/db/queries/logs.test.js +149 -146
- package/dist/db/queries/logs.test.js.map +1 -1
- package/dist/db/queries/messages.d.ts +6 -6
- package/dist/db/queries/messages.d.ts.map +1 -1
- package/dist/db/queries/messages.js +12 -11
- package/dist/db/queries/messages.js.map +1 -1
- package/dist/db/queries/messages.test.js +47 -46
- package/dist/db/queries/messages.test.js.map +1 -1
- package/dist/db/queries/pull-requests.d.ts +18 -18
- package/dist/db/queries/pull-requests.d.ts.map +1 -1
- package/dist/db/queries/pull-requests.js +50 -48
- package/dist/db/queries/pull-requests.js.map +1 -1
- package/dist/db/queries/pull-requests.test.js +195 -198
- package/dist/db/queries/pull-requests.test.js.map +1 -1
- package/dist/db/queries/requirements.d.ts +8 -8
- package/dist/db/queries/requirements.d.ts.map +1 -1
- package/dist/db/queries/requirements.js +17 -18
- package/dist/db/queries/requirements.js.map +1 -1
- package/dist/db/queries/requirements.test.js +83 -81
- package/dist/db/queries/requirements.test.js.map +1 -1
- package/dist/db/queries/stories.d.ts +29 -29
- package/dist/db/queries/stories.d.ts.map +1 -1
- package/dist/db/queries/stories.js +58 -64
- package/dist/db/queries/stories.js.map +1 -1
- package/dist/db/queries/stories.test.js +172 -170
- package/dist/db/queries/stories.test.js.map +1 -1
- package/dist/db/queries/teams.d.ts +6 -6
- package/dist/db/queries/teams.d.ts.map +1 -1
- package/dist/db/queries/teams.js +11 -12
- package/dist/db/queries/teams.js.map +1 -1
- package/dist/db/queries/teams.test.js +36 -34
- package/dist/db/queries/teams.test.js.map +1 -1
- package/dist/integrations/jira/repair.test.js +26 -24
- package/dist/integrations/jira/repair.test.js.map +1 -1
- package/dist/integrations/jira/stories.d.ts +3 -3
- package/dist/integrations/jira/stories.d.ts.map +1 -1
- package/dist/integrations/jira/stories.js +12 -12
- package/dist/integrations/jira/stories.js.map +1 -1
- package/dist/integrations/jira/stories.test.js +10 -8
- package/dist/integrations/jira/stories.test.js.map +1 -1
- package/dist/integrations/jira/sync.d.ts +7 -7
- package/dist/integrations/jira/sync.d.ts.map +1 -1
- package/dist/integrations/jira/sync.js +17 -20
- package/dist/integrations/jira/sync.js.map +1 -1
- package/dist/integrations/jira/sync.test.js +63 -62
- package/dist/integrations/jira/sync.test.js.map +1 -1
- package/dist/integrations/jira/transitions.d.ts +3 -3
- package/dist/integrations/jira/transitions.d.ts.map +1 -1
- package/dist/integrations/jira/transitions.js +3 -3
- package/dist/integrations/jira/transitions.js.map +1 -1
- package/dist/orchestrator/agent-selector.d.ts +3 -3
- package/dist/orchestrator/agent-selector.d.ts.map +1 -1
- package/dist/orchestrator/agent-selector.js +5 -6
- package/dist/orchestrator/agent-selector.js.map +1 -1
- package/dist/orchestrator/dependency-resolver.d.ts +4 -4
- package/dist/orchestrator/dependency-resolver.d.ts.map +1 -1
- package/dist/orchestrator/dependency-resolver.js +6 -6
- package/dist/orchestrator/dependency-resolver.js.map +1 -1
- package/dist/orchestrator/feature-branch.d.ts +3 -3
- package/dist/orchestrator/feature-branch.d.ts.map +1 -1
- package/dist/orchestrator/feature-branch.js +9 -10
- package/dist/orchestrator/feature-branch.js.map +1 -1
- package/dist/orchestrator/feature-branch.test.js +80 -78
- package/dist/orchestrator/feature-branch.test.js.map +1 -1
- package/dist/orchestrator/orphan-recovery.d.ts +2 -2
- package/dist/orchestrator/orphan-recovery.d.ts.map +1 -1
- package/dist/orchestrator/orphan-recovery.js +10 -10
- package/dist/orchestrator/orphan-recovery.js.map +1 -1
- package/dist/orchestrator/scheduler.d.ts +4 -4
- package/dist/orchestrator/scheduler.d.ts.map +1 -1
- package/dist/orchestrator/scheduler.js +90 -76
- package/dist/orchestrator/scheduler.js.map +1 -1
- package/dist/orchestrator/scheduler.test.js +496 -374
- package/dist/orchestrator/scheduler.test.js.map +1 -1
- package/dist/utils/auto-merge.d.ts.map +1 -1
- package/dist/utils/auto-merge.js +74 -56
- package/dist/utils/auto-merge.js.map +1 -1
- package/dist/utils/auto-merge.test.js +101 -66
- package/dist/utils/auto-merge.test.js.map +1 -1
- package/dist/utils/cli-helpers.d.ts +5 -5
- package/dist/utils/cli-helpers.d.ts.map +1 -1
- package/dist/utils/cli-helpers.js +8 -9
- package/dist/utils/cli-helpers.js.map +1 -1
- package/dist/utils/cli-helpers.test.js +28 -30
- package/dist/utils/cli-helpers.test.js.map +1 -1
- package/dist/utils/paths.d.ts +6 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +12 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/paths.test.js +1 -0
- package/dist/utils/paths.test.js.map +1 -1
- package/dist/utils/pr-sync.d.ts +10 -10
- package/dist/utils/pr-sync.d.ts.map +1 -1
- package/dist/utils/pr-sync.js +20 -21
- package/dist/utils/pr-sync.js.map +1 -1
- package/dist/utils/pr-sync.test.js +52 -50
- package/dist/utils/pr-sync.test.js.map +1 -1
- package/dist/utils/with-hive-context.d.ts.map +1 -1
- package/dist/utils/with-hive-context.js +70 -1
- package/dist/utils/with-hive-context.js.map +1 -1
- package/package.json +3 -1
- package/src/agents/base-agent.test.ts +2 -1
- package/src/agents/base-agent.ts +32 -28
- package/src/agents/intermediate.ts +27 -18
- package/src/agents/junior.ts +27 -18
- package/src/agents/qa.ts +54 -40
- package/src/agents/senior.ts +42 -27
- package/src/agents/tech-lead.ts +42 -32
- package/src/cli/commands/add-repo.test.ts +1 -1
- package/src/cli/commands/add-repo.ts +2 -2
- package/src/cli/commands/agents.test.ts +7 -7
- package/src/cli/commands/agents.ts +12 -10
- package/src/cli/commands/approach.ts +2 -2
- package/src/cli/commands/approvals.test.ts +8 -8
- package/src/cli/commands/approvals.ts +9 -7
- package/src/cli/commands/assign.test.ts +19 -18
- package/src/cli/commands/assign.ts +4 -4
- package/src/cli/commands/cleanup.test.ts +5 -1
- package/src/cli/commands/cleanup.ts +11 -9
- package/src/cli/commands/escalations.test.ts +2 -2
- package/src/cli/commands/escalations.ts +9 -7
- package/src/cli/commands/init.test.ts +5 -0
- package/src/cli/commands/init.ts +53 -5
- package/src/cli/commands/manager/agent-monitoring.ts +3 -3
- package/src/cli/commands/manager/auditor-lifecycle.test.ts +21 -14
- package/src/cli/commands/manager/auditor-lifecycle.ts +3 -3
- package/src/cli/commands/manager/auto-reject-comment-only-reviews.test.ts +28 -23
- package/src/cli/commands/manager/escalation-handler.test.ts +13 -13
- package/src/cli/commands/manager/escalation-handler.ts +19 -12
- package/src/cli/commands/manager/feature-sign-off.test.ts +40 -31
- package/src/cli/commands/manager/feature-sign-off.ts +7 -7
- package/src/cli/commands/manager/feature-test-result.ts +13 -16
- package/src/cli/commands/manager/handoff-recovery.ts +20 -20
- package/src/cli/commands/manager/index.test.ts +4 -4
- package/src/cli/commands/manager/index.ts +58 -59
- package/src/cli/commands/manager/merged-story-cleanup.test.ts +28 -19
- package/src/cli/commands/manager/merged-story-cleanup.ts +11 -14
- package/src/cli/commands/manager/pr-sync-orchestrator.ts +115 -110
- package/src/cli/commands/manager/qa-review-handler.ts +50 -63
- package/src/cli/commands/manager/spin-down.ts +27 -25
- package/src/cli/commands/manager/stale-escalations.ts +2 -3
- package/src/cli/commands/manager/stuck-story-helpers.ts +10 -10
- package/src/cli/commands/manager/stuck-story-processor.ts +56 -62
- package/src/cli/commands/manager/tech-lead-lifecycle.ts +6 -6
- package/src/cli/commands/manager/types.ts +2 -3
- package/src/cli/commands/msg.test.ts +2 -2
- package/src/cli/commands/my-stories.test.ts +4 -2
- package/src/cli/commands/my-stories.ts +22 -27
- package/src/cli/commands/nuke.test.ts +1 -1
- package/src/cli/commands/pr.test.ts +10 -6
- package/src/cli/commands/pr.ts +41 -32
- package/src/cli/commands/progress.test.ts +1 -1
- package/src/cli/commands/progress.ts +11 -6
- package/src/cli/commands/req-headless.test.ts +170 -0
- package/src/cli/commands/req-spawn.test.ts +12 -2
- package/src/cli/commands/req.ts +13 -14
- package/src/cli/commands/resume.test.ts +1 -1
- package/src/cli/commands/resume.ts +7 -8
- package/src/cli/commands/status.test.ts +1 -1
- package/src/cli/commands/status.ts +52 -40
- package/src/cli/commands/stories.test.ts +4 -2
- package/src/cli/commands/stories.ts +11 -11
- package/src/cli/commands/teams.test.ts +2 -2
- package/src/cli/commands/teams.ts +11 -11
- package/src/cli/dashboard/index.test.ts +35 -34
- package/src/cli/dashboard/index.ts +34 -23
- package/src/cli/dashboard/panels/activity.ts +10 -4
- package/src/cli/dashboard/panels/agents.ts +8 -5
- package/src/cli/dashboard/panels/escalations.ts +4 -4
- package/src/cli/dashboard/panels/merge-queue.ts +4 -4
- package/src/cli/dashboard/panels/pipeline.ts +10 -4
- package/src/config/schema.ts +1 -0
- package/src/connectors/project-management/operations.ts +9 -10
- package/src/context-files/index.test.ts +1 -0
- package/src/db/client.ts +17 -0
- package/src/db/pg-migrations/001-full-schema.sql +209 -0
- package/src/db/postgres-provider.integration.test.ts +574 -0
- package/src/db/postgres-provider.test.ts +97 -0
- package/src/db/postgres-provider.ts +364 -0
- package/src/db/provider.test.ts +283 -0
- package/src/db/provider.ts +161 -0
- package/src/db/queries/agents.test.ts +114 -113
- package/src/db/queries/agents.ts +50 -36
- package/src/db/queries/escalations.test.ts +134 -133
- package/src/db/queries/escalations.ts +72 -57
- package/src/db/queries/heartbeat.test.ts +77 -78
- package/src/db/queries/heartbeat.ts +24 -46
- package/src/db/queries/integration-sync.ts +26 -26
- package/src/db/queries/logs.test.ts +151 -148
- package/src/db/queries/logs.ts +78 -53
- package/src/db/queries/messages.test.ts +48 -50
- package/src/db/queries/messages.ts +26 -18
- package/src/db/queries/pull-requests.test.ts +194 -199
- package/src/db/queries/pull-requests.ts +117 -88
- package/src/db/queries/requirements.test.ts +84 -83
- package/src/db/queries/requirements.ts +33 -28
- package/src/db/queries/stories.test.ts +173 -172
- package/src/db/queries/stories.ts +141 -110
- package/src/db/queries/teams.test.ts +37 -36
- package/src/db/queries/teams.ts +22 -14
- package/src/integrations/jira/repair.test.ts +27 -26
- package/src/integrations/jira/stories.test.ts +15 -16
- package/src/integrations/jira/stories.ts +15 -15
- package/src/integrations/jira/sync.test.ts +68 -68
- package/src/integrations/jira/sync.ts +29 -39
- package/src/integrations/jira/transitions.ts +6 -6
- package/src/orchestrator/agent-selector.ts +9 -8
- package/src/orchestrator/dependency-resolver.ts +16 -7
- package/src/orchestrator/feature-branch.test.ts +85 -80
- package/src/orchestrator/feature-branch.ts +13 -14
- package/src/orchestrator/orphan-recovery.ts +14 -13
- package/src/orchestrator/scheduler.test.ts +536 -394
- package/src/orchestrator/scheduler.ts +129 -115
- package/src/utils/auto-merge.test.ts +102 -68
- package/src/utils/auto-merge.ts +161 -168
- package/src/utils/cli-helpers.test.ts +30 -32
- package/src/utils/cli-helpers.ts +15 -11
- package/src/utils/paths.test.ts +1 -0
- package/src/utils/paths.ts +14 -1
- package/src/utils/pr-sync.test.ts +55 -52
- package/src/utils/pr-sync.ts +27 -32
- package/src/utils/with-hive-context.ts +89 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import { syncStatusForStory } from '../../connectors/project-management/operations.js';
|
|
6
|
-
import {
|
|
6
|
+
import type { StoryRow } from '../../db/client.js';
|
|
7
7
|
import { createLog } from '../../db/queries/logs.js';
|
|
8
8
|
import { createStory, getStoryDependencies, updateStory } from '../../db/queries/stories.js';
|
|
9
9
|
import { requireAgentBySession, requireStory } from '../../utils/cli-helpers.js';
|
|
@@ -17,8 +17,9 @@ export const myStoriesCommand = new Command('my-stories')
|
|
|
17
17
|
await withReadOnlyHiveContext(async ({ db }) => {
|
|
18
18
|
if (!session) {
|
|
19
19
|
// Show all in-progress stories
|
|
20
|
-
const stories = queryAll<
|
|
21
|
-
|
|
20
|
+
const stories = await db.provider.queryAll<
|
|
21
|
+
StoryRow & { tmux_session?: string; target_branch?: string }
|
|
22
|
+
>(
|
|
22
23
|
`
|
|
23
24
|
SELECT s.*, a.tmux_session, r.target_branch
|
|
24
25
|
FROM stories s
|
|
@@ -42,8 +43,7 @@ export const myStoriesCommand = new Command('my-stories')
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
// Find agent by tmux session
|
|
45
|
-
const agent = queryOne<{ id: string; team_id: string }>(
|
|
46
|
-
db.db,
|
|
46
|
+
const agent = await db.provider.queryOne<{ id: string; team_id: string }>(
|
|
47
47
|
"SELECT id, team_id FROM agents WHERE tmux_session = ? AND status != 'terminated'",
|
|
48
48
|
[session]
|
|
49
49
|
);
|
|
@@ -51,8 +51,7 @@ export const myStoriesCommand = new Command('my-stories')
|
|
|
51
51
|
if (!agent) {
|
|
52
52
|
console.error(chalk.red(`No agent found with session: ${session}`));
|
|
53
53
|
console.log(chalk.gray('Available sessions:'));
|
|
54
|
-
const agents = queryAll<{ tmux_session: string }>(
|
|
55
|
-
db.db,
|
|
54
|
+
const agents = await db.provider.queryAll<{ tmux_session: string }>(
|
|
56
55
|
"SELECT tmux_session FROM agents WHERE tmux_session IS NOT NULL AND status != 'terminated'"
|
|
57
56
|
);
|
|
58
57
|
for (const a of agents) {
|
|
@@ -64,8 +63,7 @@ export const myStoriesCommand = new Command('my-stories')
|
|
|
64
63
|
let stories: (StoryRow & { target_branch?: string })[];
|
|
65
64
|
if (options.all && agent.team_id) {
|
|
66
65
|
// Show all team stories
|
|
67
|
-
stories = queryAll<StoryRow & { target_branch?: string }>(
|
|
68
|
-
db.db,
|
|
66
|
+
stories = await db.provider.queryAll<StoryRow & { target_branch?: string }>(
|
|
69
67
|
`
|
|
70
68
|
SELECT s.*, r.target_branch
|
|
71
69
|
FROM stories s
|
|
@@ -85,8 +83,7 @@ export const myStoriesCommand = new Command('my-stories')
|
|
|
85
83
|
);
|
|
86
84
|
} else {
|
|
87
85
|
// Show only assigned active stories (exclude merged/terminal states)
|
|
88
|
-
stories = queryAll<StoryRow & { target_branch?: string }>(
|
|
89
|
-
db.db,
|
|
86
|
+
stories = await db.provider.queryAll<StoryRow & { target_branch?: string }>(
|
|
90
87
|
`
|
|
91
88
|
SELECT s.*, r.target_branch
|
|
92
89
|
FROM stories s
|
|
@@ -124,10 +121,10 @@ myStoriesCommand
|
|
|
124
121
|
.action(async (storyId: string, options: { session: string }) => {
|
|
125
122
|
await withHiveContext(async ({ root, db }) => {
|
|
126
123
|
// Find agent by session
|
|
127
|
-
const agent = requireAgentBySession(db.
|
|
124
|
+
const agent = await requireAgentBySession(db.provider, options.session);
|
|
128
125
|
|
|
129
126
|
// Check story exists and is available
|
|
130
|
-
const story = requireStory(db.
|
|
127
|
+
const story = await requireStory(db.provider, storyId);
|
|
131
128
|
|
|
132
129
|
if (story.assigned_agent_id && story.assigned_agent_id !== agent.id) {
|
|
133
130
|
console.error(chalk.red(`Story already assigned to another agent.`));
|
|
@@ -135,7 +132,7 @@ myStoriesCommand
|
|
|
135
132
|
}
|
|
136
133
|
|
|
137
134
|
// Check if all dependencies are resolved (merged)
|
|
138
|
-
const dependencies = getStoryDependencies(db.
|
|
135
|
+
const dependencies = await getStoryDependencies(db.provider, storyId);
|
|
139
136
|
const unresolvedDeps = dependencies.filter(dep => dep.status !== 'merged');
|
|
140
137
|
if (unresolvedDeps.length > 0) {
|
|
141
138
|
console.error(chalk.red(`Cannot claim story: unresolved dependencies`));
|
|
@@ -149,8 +146,7 @@ myStoriesCommand
|
|
|
149
146
|
}
|
|
150
147
|
|
|
151
148
|
// Claim the story
|
|
152
|
-
run(
|
|
153
|
-
db.db,
|
|
149
|
+
await db.provider.run(
|
|
154
150
|
`
|
|
155
151
|
UPDATE stories
|
|
156
152
|
SET assigned_agent_id = ?, status = 'in_progress', updated_at = datetime('now')
|
|
@@ -161,7 +157,7 @@ myStoriesCommand
|
|
|
161
157
|
db.save();
|
|
162
158
|
|
|
163
159
|
// Sync status change to Jira
|
|
164
|
-
await syncStatusForStory(root, db.
|
|
160
|
+
await syncStatusForStory(root, db.provider, storyId, 'in_progress');
|
|
165
161
|
|
|
166
162
|
console.log(chalk.green(`Claimed story: ${storyId}`));
|
|
167
163
|
console.log(chalk.gray(`Title: ${story.title}`));
|
|
@@ -173,10 +169,9 @@ myStoriesCommand
|
|
|
173
169
|
.description('Mark a story as complete (ready for review)')
|
|
174
170
|
.action(async (storyId: string) => {
|
|
175
171
|
await withHiveContext(async ({ root, db }) => {
|
|
176
|
-
requireStory(db.
|
|
172
|
+
await requireStory(db.provider, storyId);
|
|
177
173
|
|
|
178
|
-
run(
|
|
179
|
-
db.db,
|
|
174
|
+
await db.provider.run(
|
|
180
175
|
`
|
|
181
176
|
UPDATE stories
|
|
182
177
|
SET status = 'review', updated_at = datetime('now')
|
|
@@ -187,7 +182,7 @@ myStoriesCommand
|
|
|
187
182
|
db.save();
|
|
188
183
|
|
|
189
184
|
// Sync status change to Jira
|
|
190
|
-
await syncStatusForStory(root, db.
|
|
185
|
+
await syncStatusForStory(root, db.provider, storyId, 'review');
|
|
191
186
|
|
|
192
187
|
console.log(chalk.green(`Story ${storyId} marked as ready for review.`));
|
|
193
188
|
});
|
|
@@ -229,7 +224,7 @@ myStoriesCommand
|
|
|
229
224
|
}
|
|
230
225
|
|
|
231
226
|
await withHiveContext(async ({ paths, db }) => {
|
|
232
|
-
const agent = requireAgentBySession(db.
|
|
227
|
+
const agent = await requireAgentBySession(db.provider, options.session);
|
|
233
228
|
|
|
234
229
|
if (!agent.team_id) {
|
|
235
230
|
console.error(
|
|
@@ -245,8 +240,8 @@ myStoriesCommand
|
|
|
245
240
|
? trimmedTitle
|
|
246
241
|
: `Refactor: ${trimmedTitle}`;
|
|
247
242
|
|
|
248
|
-
const story = createStory(
|
|
249
|
-
db.
|
|
243
|
+
const story = await createStory(
|
|
244
|
+
db.provider,
|
|
250
245
|
{
|
|
251
246
|
teamId: agent.team_id,
|
|
252
247
|
title: normalizedTitle,
|
|
@@ -257,8 +252,8 @@ myStoriesCommand
|
|
|
257
252
|
paths.storiesDir
|
|
258
253
|
);
|
|
259
254
|
|
|
260
|
-
const updatedStory = updateStory(
|
|
261
|
-
db.
|
|
255
|
+
const updatedStory = await updateStory(
|
|
256
|
+
db.provider,
|
|
262
257
|
story.id,
|
|
263
258
|
{
|
|
264
259
|
complexityScore: points,
|
|
@@ -268,7 +263,7 @@ myStoriesCommand
|
|
|
268
263
|
paths.storiesDir
|
|
269
264
|
);
|
|
270
265
|
|
|
271
|
-
createLog(db.
|
|
266
|
+
await createLog(db.provider, {
|
|
272
267
|
agentId: agent.id,
|
|
273
268
|
storyId: story.id,
|
|
274
269
|
eventType: 'STORY_CREATED',
|
|
@@ -19,7 +19,7 @@ vi.mock('../../git/worktree.js', () => ({
|
|
|
19
19
|
|
|
20
20
|
vi.mock('../../utils/with-hive-context.js', () => ({
|
|
21
21
|
withHiveContext: vi.fn(callback =>
|
|
22
|
-
callback({ db: { db: {}, save: vi.fn() }, root: '/root', paths: {} })
|
|
22
|
+
callback({ db: { db: {}, provider: {}, save: vi.fn() }, root: '/root', paths: {} })
|
|
23
23
|
),
|
|
24
24
|
}));
|
|
25
25
|
|
|
@@ -89,9 +89,13 @@ vi.mock('../../utils/story-id.js', () => ({
|
|
|
89
89
|
|
|
90
90
|
vi.mock('../../utils/with-hive-context.js', () => ({
|
|
91
91
|
withHiveContext: vi.fn(callback =>
|
|
92
|
-
callback({
|
|
92
|
+
callback({
|
|
93
|
+
db: { db: {}, provider: {}, save: vi.fn() },
|
|
94
|
+
root: '/tmp',
|
|
95
|
+
paths: { hiveDir: '/tmp/.hive' },
|
|
96
|
+
})
|
|
93
97
|
),
|
|
94
|
-
withReadOnlyHiveContext: vi.fn(callback => callback({ db: { db: {} } })),
|
|
98
|
+
withReadOnlyHiveContext: vi.fn(callback => callback({ db: { db: {}, provider: {} } })),
|
|
95
99
|
}));
|
|
96
100
|
|
|
97
101
|
import { prCommand } from './pr.js';
|
|
@@ -114,7 +118,7 @@ describe('pr command', () => {
|
|
|
114
118
|
vi.clearAllMocks();
|
|
115
119
|
resetCommandOptions(prCommand);
|
|
116
120
|
|
|
117
|
-
vi.mocked(getPullRequestById).
|
|
121
|
+
vi.mocked(getPullRequestById).mockResolvedValue({
|
|
118
122
|
id: 'pr-1',
|
|
119
123
|
story_id: 'TEST-1',
|
|
120
124
|
team_id: 'team-1',
|
|
@@ -216,7 +220,7 @@ describe('pr command', () => {
|
|
|
216
220
|
});
|
|
217
221
|
|
|
218
222
|
it('should auto-close existing PRs with different github_pr_number', async () => {
|
|
219
|
-
vi.mocked(getOpenPullRequestsByStory).
|
|
223
|
+
vi.mocked(getOpenPullRequestsByStory).mockResolvedValue([
|
|
220
224
|
{
|
|
221
225
|
id: 'old-pr-1',
|
|
222
226
|
story_id: 'TEST-1',
|
|
@@ -267,7 +271,7 @@ describe('pr command', () => {
|
|
|
267
271
|
});
|
|
268
272
|
|
|
269
273
|
it('should not close GitHub PR when auto-closing duplicate internal PR records', async () => {
|
|
270
|
-
vi.mocked(getOpenPullRequestsByStory).
|
|
274
|
+
vi.mocked(getOpenPullRequestsByStory).mockResolvedValue([
|
|
271
275
|
{
|
|
272
276
|
id: 'old-pr-1',
|
|
273
277
|
story_id: 'TEST-1',
|
|
@@ -310,7 +314,7 @@ describe('pr command', () => {
|
|
|
310
314
|
});
|
|
311
315
|
|
|
312
316
|
it('should skip auto-close when resubmitting same github PR number', async () => {
|
|
313
|
-
vi.mocked(getOpenPullRequestsByStory).
|
|
317
|
+
vi.mocked(getOpenPullRequestsByStory).mockResolvedValue([
|
|
314
318
|
{
|
|
315
319
|
id: 'existing-pr-1',
|
|
316
320
|
story_id: 'TEST-1',
|
package/src/cli/commands/pr.ts
CHANGED
|
@@ -56,20 +56,20 @@ prCommand
|
|
|
56
56
|
|
|
57
57
|
// Get team from story
|
|
58
58
|
let teamId = options.team || null;
|
|
59
|
-
const story = requireStory(db.
|
|
59
|
+
const story = await requireStory(db.provider, storyId);
|
|
60
60
|
|
|
61
61
|
teamId = story.team_id;
|
|
62
62
|
|
|
63
63
|
// Auto-close any existing open PRs for this story
|
|
64
64
|
const incomingPrNumber = options.prNumber ? parseInt(options.prNumber, 10) : null;
|
|
65
|
-
const existingPRs = getOpenPullRequestsByStory(db.
|
|
65
|
+
const existingPRs = await getOpenPullRequestsByStory(db.provider, storyId);
|
|
66
66
|
for (const existingPR of existingPRs) {
|
|
67
67
|
// Skip auto-close if this is a resubmit of the same GitHub PR
|
|
68
68
|
if (incomingPrNumber !== null && existingPR.github_pr_number === incomingPrNumber) {
|
|
69
69
|
continue;
|
|
70
70
|
}
|
|
71
|
-
updatePullRequest(db.
|
|
72
|
-
createLog(db.
|
|
71
|
+
await updatePullRequest(db.provider, existingPR.id, { status: 'closed' });
|
|
72
|
+
await createLog(db.provider, {
|
|
73
73
|
agentId: options.from || 'system',
|
|
74
74
|
storyId,
|
|
75
75
|
eventType: 'PR_CLOSED',
|
|
@@ -79,12 +79,12 @@ prCommand
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// Update story status
|
|
82
|
-
updateStory(db.
|
|
82
|
+
await updateStory(db.provider, storyId, { status: 'pr_submitted' });
|
|
83
83
|
|
|
84
84
|
// Sync status change to Jira
|
|
85
|
-
await syncStatusForStory(root, db.
|
|
85
|
+
await syncStatusForStory(root, db.provider, storyId, 'pr_submitted');
|
|
86
86
|
|
|
87
|
-
const pr = createPullRequest(db.
|
|
87
|
+
const pr = await createPullRequest(db.provider, {
|
|
88
88
|
storyId,
|
|
89
89
|
teamId,
|
|
90
90
|
branchName: options.branch,
|
|
@@ -95,7 +95,7 @@ prCommand
|
|
|
95
95
|
|
|
96
96
|
db.save();
|
|
97
97
|
|
|
98
|
-
const position = getQueuePosition(db.
|
|
98
|
+
const position = await getQueuePosition(db.provider, pr.id);
|
|
99
99
|
|
|
100
100
|
console.log(chalk.green(`PR submitted to merge queue`));
|
|
101
101
|
console.log(chalk.gray(` ID: ${pr.id}`));
|
|
@@ -106,7 +106,7 @@ prCommand
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
if (options.from) {
|
|
109
|
-
createLog(db.
|
|
109
|
+
await createLog(db.provider, {
|
|
110
110
|
agentId: options.from,
|
|
111
111
|
storyId: storyId || undefined,
|
|
112
112
|
eventType: 'PR_SUBMITTED',
|
|
@@ -119,7 +119,7 @@ prCommand
|
|
|
119
119
|
// Post Jira comment for PR created event
|
|
120
120
|
try {
|
|
121
121
|
const config = loadConfig(paths.hiveDir);
|
|
122
|
-
await postLifecycleComment(db.
|
|
122
|
+
await postLifecycleComment(db.provider, paths.hiveDir, config, storyId, 'pr_created', {
|
|
123
123
|
agentName: options.from,
|
|
124
124
|
prUrl: pr.github_pr_url || undefined,
|
|
125
125
|
});
|
|
@@ -135,7 +135,7 @@ prCommand
|
|
|
135
135
|
: null;
|
|
136
136
|
|
|
137
137
|
if (!config.cluster.enabled || clusterStatus?.is_leader) {
|
|
138
|
-
const scheduler = new Scheduler(db.
|
|
138
|
+
const scheduler = new Scheduler(db.provider, {
|
|
139
139
|
scaling: config.scaling,
|
|
140
140
|
models: config.models,
|
|
141
141
|
qa: config.qa,
|
|
@@ -162,7 +162,7 @@ prCommand
|
|
|
162
162
|
.option('--json', 'Output as JSON')
|
|
163
163
|
.action(async (options: { team?: string; json?: boolean }) => {
|
|
164
164
|
await withReadOnlyHiveContext(async ({ db }) => {
|
|
165
|
-
const queue = getMergeQueue(db.
|
|
165
|
+
const queue = await getMergeQueue(db.provider, options.team);
|
|
166
166
|
|
|
167
167
|
if (options.json) {
|
|
168
168
|
console.log(JSON.stringify(queue, null, 2));
|
|
@@ -204,14 +204,14 @@ prCommand
|
|
|
204
204
|
.option('--from <session>', 'QA agent session')
|
|
205
205
|
.action(async (options: { team?: string; from?: string }) => {
|
|
206
206
|
await withHiveContext(async ({ db }) => {
|
|
207
|
-
const pr = getNextInQueue(db.
|
|
207
|
+
const pr = await getNextInQueue(db.provider, options.team);
|
|
208
208
|
|
|
209
209
|
if (!pr) {
|
|
210
210
|
console.log(chalk.yellow('No PRs waiting for review.'));
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
updatePullRequest(db.
|
|
214
|
+
await updatePullRequest(db.provider, pr.id, {
|
|
215
215
|
status: 'reviewing',
|
|
216
216
|
reviewedBy: options.from || null,
|
|
217
217
|
});
|
|
@@ -230,7 +230,7 @@ prCommand
|
|
|
230
230
|
console.log(chalk.gray(` hive pr reject ${pr.id} --reason "..."`));
|
|
231
231
|
|
|
232
232
|
if (options.from) {
|
|
233
|
-
createLog(db.
|
|
233
|
+
await createLog(db.provider, {
|
|
234
234
|
agentId: options.from,
|
|
235
235
|
storyId: pr.story_id || undefined,
|
|
236
236
|
eventType: 'PR_REVIEW_STARTED',
|
|
@@ -248,7 +248,7 @@ prCommand
|
|
|
248
248
|
.description('View details of a PR')
|
|
249
249
|
.action(async (prId: string) => {
|
|
250
250
|
await withReadOnlyHiveContext(async ({ db }) => {
|
|
251
|
-
const pr = requirePullRequest(db.
|
|
251
|
+
const pr = await requirePullRequest(db.provider, prId);
|
|
252
252
|
|
|
253
253
|
console.log(chalk.bold(`\nPull Request: ${pr.id}\n`));
|
|
254
254
|
console.log(chalk.gray(`Branch: ${pr.branch_name}`));
|
|
@@ -267,7 +267,7 @@ prCommand
|
|
|
267
267
|
console.log(pr.review_notes);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
const position = getQueuePosition(db.
|
|
270
|
+
const position = await getQueuePosition(db.provider, pr.id);
|
|
271
271
|
if (position > 0) {
|
|
272
272
|
console.log(chalk.cyan(`\nQueue Position: ${position}`));
|
|
273
273
|
}
|
|
@@ -284,7 +284,7 @@ prCommand
|
|
|
284
284
|
.option('--no-merge', 'Approve without merging (manual merge needed)')
|
|
285
285
|
.action(async (prId: string, options: { notes?: string; from?: string; merge?: boolean }) => {
|
|
286
286
|
await withHiveContext(async ({ root, db }) => {
|
|
287
|
-
const pr = requirePullRequest(db.
|
|
287
|
+
const pr = await requirePullRequest(db.provider, prId);
|
|
288
288
|
|
|
289
289
|
if (pr.status === 'merged') {
|
|
290
290
|
console.log(chalk.yellow('PR already merged.'));
|
|
@@ -305,7 +305,7 @@ prCommand
|
|
|
305
305
|
// Use the team's repo path as cwd so gh knows which repo to operate on
|
|
306
306
|
let repoCwd = root;
|
|
307
307
|
if (pr.team_id) {
|
|
308
|
-
const team = getTeamById(db.
|
|
308
|
+
const team = await getTeamById(db.provider, pr.team_id);
|
|
309
309
|
if (team?.repo_path) {
|
|
310
310
|
repoCwd = join(root, team.repo_path);
|
|
311
311
|
}
|
|
@@ -347,21 +347,21 @@ prCommand
|
|
|
347
347
|
? markManualMergeRequired(options.notes)
|
|
348
348
|
: (options.notes ?? null);
|
|
349
349
|
|
|
350
|
-
updatePullRequest(db.
|
|
350
|
+
await updatePullRequest(db.provider, prId, {
|
|
351
351
|
status: newStatus,
|
|
352
352
|
reviewedBy: options.from || pr.reviewed_by,
|
|
353
353
|
reviewNotes,
|
|
354
354
|
});
|
|
355
355
|
|
|
356
356
|
if (storyId && newStatus === 'merged') {
|
|
357
|
-
updateStory(db.
|
|
357
|
+
await updateStory(db.provider, storyId, { status: 'merged' });
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
db.save();
|
|
361
361
|
|
|
362
362
|
// Sync status change to Jira
|
|
363
363
|
if (storyId && newStatus === 'merged') {
|
|
364
|
-
await syncStatusForStory(root, db.
|
|
364
|
+
await syncStatusForStory(root, db.provider, storyId, 'merged');
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
// Immediately attempt to auto-merge approved PRs instead of waiting for manager daemon cycle
|
|
@@ -386,7 +386,7 @@ prCommand
|
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
if (options.from) {
|
|
389
|
-
createLog(db.
|
|
389
|
+
await createLog(db.provider, {
|
|
390
390
|
agentId: options.from,
|
|
391
391
|
storyId: storyId || undefined,
|
|
392
392
|
eventType: newStatus === 'merged' ? 'PR_MERGED' : 'PR_APPROVED',
|
|
@@ -406,9 +406,9 @@ prCommand
|
|
|
406
406
|
.option('--from <session>', 'QA agent session')
|
|
407
407
|
.action(async (prId: string, options: { reason: string; from?: string }) => {
|
|
408
408
|
await withHiveContext(async ({ root, db }) => {
|
|
409
|
-
const pr = requirePullRequest(db.
|
|
409
|
+
const pr = await requirePullRequest(db.provider, prId);
|
|
410
410
|
|
|
411
|
-
updatePullRequest(db.
|
|
411
|
+
await updatePullRequest(db.provider, prId, {
|
|
412
412
|
status: 'rejected',
|
|
413
413
|
reviewedBy: options.from || pr.reviewed_by,
|
|
414
414
|
reviewNotes: options.reason,
|
|
@@ -420,14 +420,14 @@ prCommand
|
|
|
420
420
|
storyId = extractStoryIdFromBranch(pr.branch_name);
|
|
421
421
|
}
|
|
422
422
|
if (storyId) {
|
|
423
|
-
updateStory(db.
|
|
423
|
+
await updateStory(db.provider, storyId, { status: 'qa_failed' });
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
db.save();
|
|
427
427
|
|
|
428
428
|
// Sync status change to Jira
|
|
429
429
|
if (storyId) {
|
|
430
|
-
await syncStatusForStory(root, db.
|
|
430
|
+
await syncStatusForStory(root, db.provider, storyId, 'qa_failed');
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
console.log(chalk.yellow(`PR ${prId} rejected.`));
|
|
@@ -461,7 +461,7 @@ prCommand
|
|
|
461
461
|
}
|
|
462
462
|
|
|
463
463
|
if (options.from) {
|
|
464
|
-
createLog(db.
|
|
464
|
+
await createLog(db.provider, {
|
|
465
465
|
agentId: options.from,
|
|
466
466
|
storyId: storyId || undefined,
|
|
467
467
|
eventType: 'PR_REJECTED',
|
|
@@ -480,7 +480,10 @@ prCommand
|
|
|
480
480
|
.option('-r, --repo <path>', 'Repository path (relative to repos/)')
|
|
481
481
|
.action(async (options: { repo?: string }) => {
|
|
482
482
|
await withHiveContext(async ({ root, paths, db }) => {
|
|
483
|
-
const { existingBranches, existingPrNumbers } = getExistingPRIdentifiers(
|
|
483
|
+
const { existingBranches, existingPrNumbers } = await getExistingPRIdentifiers(
|
|
484
|
+
db.provider,
|
|
485
|
+
false
|
|
486
|
+
);
|
|
484
487
|
|
|
485
488
|
// Find repo directory
|
|
486
489
|
const repoDir = options.repo ? `${root}/repos/${options.repo}` : process.cwd();
|
|
@@ -489,7 +492,13 @@ prCommand
|
|
|
489
492
|
|
|
490
493
|
let result;
|
|
491
494
|
try {
|
|
492
|
-
result = await syncOpenGitHubPRs(
|
|
495
|
+
result = await syncOpenGitHubPRs(
|
|
496
|
+
db.provider,
|
|
497
|
+
repoDir,
|
|
498
|
+
null,
|
|
499
|
+
existingBranches,
|
|
500
|
+
existingPrNumbers
|
|
501
|
+
);
|
|
493
502
|
} catch (err) {
|
|
494
503
|
console.error(chalk.red('Failed to list GitHub PRs. Is gh CLI authenticated?'), err);
|
|
495
504
|
process.exit(1);
|
|
@@ -512,7 +521,7 @@ prCommand
|
|
|
512
521
|
: null;
|
|
513
522
|
|
|
514
523
|
if (!config.cluster.enabled || clusterStatus?.is_leader) {
|
|
515
|
-
const scheduler = new Scheduler(db.
|
|
524
|
+
const scheduler = new Scheduler(db.provider, {
|
|
516
525
|
scaling: config.scaling,
|
|
517
526
|
models: config.models,
|
|
518
527
|
rootDir: root,
|
|
@@ -541,7 +550,7 @@ prCommand
|
|
|
541
550
|
.action(async (options: { limit?: string; json?: boolean }) => {
|
|
542
551
|
await withReadOnlyHiveContext(async ({ db }) => {
|
|
543
552
|
const limit = parseInt(options.limit ?? '20', 10);
|
|
544
|
-
const logs = getLogsByEventType(db.
|
|
553
|
+
const logs = await getLogsByEventType(db.provider, 'PR_CLOSED', limit);
|
|
545
554
|
|
|
546
555
|
if (options.json) {
|
|
547
556
|
console.log(JSON.stringify(logs, null, 2));
|
|
@@ -44,7 +44,7 @@ vi.mock('../../integrations/jira/comments.js', () => ({
|
|
|
44
44
|
|
|
45
45
|
vi.mock('../../utils/with-hive-context.js', () => ({
|
|
46
46
|
withHiveContext: vi.fn(callback =>
|
|
47
|
-
callback({ root: '/tmp', db: { db: {} }, paths: { hiveDir: '/tmp/.hive' } })
|
|
47
|
+
callback({ root: '/tmp', db: { db: {}, provider: {} }, paths: { hiveDir: '/tmp/.hive' } })
|
|
48
48
|
),
|
|
49
49
|
}));
|
|
50
50
|
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
postProgressUpdate,
|
|
8
8
|
transitionSubtaskStatus,
|
|
9
9
|
} from '../../connectors/project-management/operations.js';
|
|
10
|
-
import { queryOne } from '../../db/client.js';
|
|
11
10
|
import { createLog } from '../../db/queries/logs.js';
|
|
12
11
|
import { requireStory } from '../../utils/cli-helpers.js';
|
|
13
12
|
import { withHiveContext } from '../../utils/with-hive-context.js';
|
|
@@ -24,7 +23,7 @@ export const progressCommand = new Command('progress')
|
|
|
24
23
|
const pmProvider = config.integrations?.project_management?.provider || 'none';
|
|
25
24
|
|
|
26
25
|
if (pmProvider === 'none') {
|
|
27
|
-
createLog(db.
|
|
26
|
+
await createLog(db.provider, {
|
|
28
27
|
agentId: options.from || 'manager',
|
|
29
28
|
storyId,
|
|
30
29
|
eventType: 'STORY_PROGRESS_UPDATE',
|
|
@@ -43,7 +42,7 @@ export const progressCommand = new Command('progress')
|
|
|
43
42
|
return;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
const story = requireStory(db.
|
|
45
|
+
const story = await requireStory(db.provider, storyId);
|
|
47
46
|
|
|
48
47
|
if (!story.external_subtask_key) {
|
|
49
48
|
console.error(
|
|
@@ -60,8 +59,7 @@ export const progressCommand = new Command('progress')
|
|
|
60
59
|
// Resolve agent name from session if provided
|
|
61
60
|
let agentName = options.from;
|
|
62
61
|
if (options.from) {
|
|
63
|
-
const agent = queryOne<{ id: string; tmux_session: string }>(
|
|
64
|
-
db.db,
|
|
62
|
+
const agent = await db.provider.queryOne<{ id: string; tmux_session: string }>(
|
|
65
63
|
"SELECT id, tmux_session FROM agents WHERE tmux_session = ? AND status != 'terminated'",
|
|
66
64
|
[options.from]
|
|
67
65
|
);
|
|
@@ -70,7 +68,14 @@ export const progressCommand = new Command('progress')
|
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
70
|
|
|
73
|
-
await postProgressUpdate(
|
|
71
|
+
await postProgressUpdate(
|
|
72
|
+
db.provider,
|
|
73
|
+
paths.hiveDir,
|
|
74
|
+
config,
|
|
75
|
+
storyId,
|
|
76
|
+
options.message,
|
|
77
|
+
agentName
|
|
78
|
+
);
|
|
74
79
|
|
|
75
80
|
console.log(chalk.green(`Posted progress update to subtask ${story.external_subtask_key}`));
|
|
76
81
|
|