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,11 +3,11 @@
|
|
|
3
3
|
import { mkdtempSync, writeFileSync } from 'fs';
|
|
4
4
|
import { tmpdir } from 'os';
|
|
5
5
|
import { join } from 'path';
|
|
6
|
-
import type { Database } from 'sql.js';
|
|
7
6
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
8
7
|
import { TokenStore } from '../../auth/token-store.js';
|
|
9
8
|
import type { JiraConfig } from '../../config/schema.js';
|
|
10
9
|
import { run } from '../../db/client.js';
|
|
10
|
+
import { SqliteProvider } from '../../db/provider.js';
|
|
11
11
|
import { createSyncRecord } from '../../db/queries/integration-sync.js';
|
|
12
12
|
import { createStory, getStoryById } from '../../db/queries/stories.js';
|
|
13
13
|
import { createTestDatabase } from '../../db/queries/test-helpers.js';
|
|
@@ -89,7 +89,7 @@ describe('isForwardTransition', () => {
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
describe('syncJiraStatusesToHive', () => {
|
|
92
|
-
let db:
|
|
92
|
+
let db: SqliteProvider;
|
|
93
93
|
let envDir: string;
|
|
94
94
|
|
|
95
95
|
const baseConfig: JiraConfig = {
|
|
@@ -122,10 +122,10 @@ describe('syncJiraStatusesToHive', () => {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
beforeEach(async () => {
|
|
125
|
-
db = await createTestDatabase();
|
|
125
|
+
db = new SqliteProvider(await createTestDatabase());
|
|
126
126
|
envDir = mkdtempSync(join(tmpdir(), 'hive-sync-test-'));
|
|
127
127
|
// Create a manager agent for logging purposes
|
|
128
|
-
db.run(`INSERT INTO agents (id, type, status) VALUES ('manager', 'tech_lead', 'idle')`);
|
|
128
|
+
db.db.run(`INSERT INTO agents (id, type, status) VALUES ('manager', 'tech_lead', 'idle')`);
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
it('skips sync when no status mapping configured', async () => {
|
|
@@ -138,7 +138,7 @@ describe('syncJiraStatusesToHive', () => {
|
|
|
138
138
|
|
|
139
139
|
it('skips stories without Jira issue key', async () => {
|
|
140
140
|
// Create story without Jira key
|
|
141
|
-
createStory(db, {
|
|
141
|
+
await createStory(db, {
|
|
142
142
|
title: 'Test Story',
|
|
143
143
|
description: 'Test',
|
|
144
144
|
});
|
|
@@ -152,14 +152,14 @@ describe('syncJiraStatusesToHive', () => {
|
|
|
152
152
|
|
|
153
153
|
it('syncs Jira status to Hive when different', async () => {
|
|
154
154
|
// Create story with Jira key
|
|
155
|
-
const story = createStory(db, {
|
|
155
|
+
const story = await createStory(db, {
|
|
156
156
|
title: 'Test Story',
|
|
157
157
|
description: 'Test',
|
|
158
158
|
});
|
|
159
159
|
|
|
160
160
|
// Update story to add Jira key and set initial status
|
|
161
161
|
run(
|
|
162
|
-
db,
|
|
162
|
+
db.db,
|
|
163
163
|
'UPDATE stories SET jira_issue_key = ?, external_issue_key = ?, status = ? WHERE id = ?',
|
|
164
164
|
['TEST-123', 'TEST-123', 'planned', story.id]
|
|
165
165
|
);
|
|
@@ -212,18 +212,18 @@ describe('syncJiraStatusesToHive', () => {
|
|
|
212
212
|
expect(updated).toBe(1);
|
|
213
213
|
|
|
214
214
|
// Verify story was updated
|
|
215
|
-
const updatedStory = getStoryById(db, story.id);
|
|
215
|
+
const updatedStory = await getStoryById(db, story.id);
|
|
216
216
|
expect(updatedStory?.status).toBe('in_progress');
|
|
217
217
|
});
|
|
218
218
|
|
|
219
219
|
it('skips sync when Jira status matches Hive status', async () => {
|
|
220
|
-
const story = createStory(db, {
|
|
220
|
+
const story = await createStory(db, {
|
|
221
221
|
title: 'Test Story',
|
|
222
222
|
description: 'Test',
|
|
223
223
|
});
|
|
224
224
|
|
|
225
225
|
run(
|
|
226
|
-
db,
|
|
226
|
+
db.db,
|
|
227
227
|
'UPDATE stories SET jira_issue_key = ?, external_issue_key = ?, status = ? WHERE id = ?',
|
|
228
228
|
['TEST-123', 'TEST-123', 'in_progress', story.id]
|
|
229
229
|
);
|
|
@@ -273,13 +273,13 @@ describe('syncJiraStatusesToHive', () => {
|
|
|
273
273
|
});
|
|
274
274
|
|
|
275
275
|
it('handles API errors gracefully', async () => {
|
|
276
|
-
const story = createStory(db, {
|
|
276
|
+
const story = await createStory(db, {
|
|
277
277
|
title: 'Test Story',
|
|
278
278
|
description: 'Test',
|
|
279
279
|
});
|
|
280
280
|
|
|
281
281
|
run(
|
|
282
|
-
db,
|
|
282
|
+
db.db,
|
|
283
283
|
'UPDATE stories SET jira_issue_key = ?, external_issue_key = ?, status = ? WHERE id = ?',
|
|
284
284
|
['TEST-123', 'TEST-123', 'planned', story.id]
|
|
285
285
|
);
|
|
@@ -304,13 +304,13 @@ describe('syncJiraStatusesToHive', () => {
|
|
|
304
304
|
|
|
305
305
|
it('skips backward transitions (prevents status regression)', async () => {
|
|
306
306
|
// Story is in_progress in Hive, but Jira says "To Do" (which maps to planned)
|
|
307
|
-
const story = createStory(db, {
|
|
307
|
+
const story = await createStory(db, {
|
|
308
308
|
title: 'Test Story',
|
|
309
309
|
description: 'Test',
|
|
310
310
|
});
|
|
311
311
|
|
|
312
312
|
run(
|
|
313
|
-
db,
|
|
313
|
+
db.db,
|
|
314
314
|
'UPDATE stories SET jira_issue_key = ?, external_issue_key = ?, status = ? WHERE id = ?',
|
|
315
315
|
['TEST-123', 'TEST-123', 'in_progress', story.id]
|
|
316
316
|
);
|
|
@@ -364,18 +364,18 @@ describe('syncJiraStatusesToHive', () => {
|
|
|
364
364
|
expect(updated).toBe(0);
|
|
365
365
|
|
|
366
366
|
// Verify story was NOT regressed
|
|
367
|
-
const updatedStory = getStoryById(db, story.id);
|
|
367
|
+
const updatedStory = await getStoryById(db, story.id);
|
|
368
368
|
expect(updatedStory?.status).toBe('in_progress');
|
|
369
369
|
});
|
|
370
370
|
|
|
371
371
|
it('skips merged stories', async () => {
|
|
372
|
-
const story = createStory(db, {
|
|
372
|
+
const story = await createStory(db, {
|
|
373
373
|
title: 'Test Story',
|
|
374
374
|
description: 'Test',
|
|
375
375
|
});
|
|
376
376
|
|
|
377
377
|
run(
|
|
378
|
-
db,
|
|
378
|
+
db.db,
|
|
379
379
|
'UPDATE stories SET jira_issue_key = ?, external_issue_key = ?, status = ? WHERE id = ?',
|
|
380
380
|
['TEST-123', 'TEST-123', 'merged', story.id]
|
|
381
381
|
);
|
|
@@ -389,7 +389,7 @@ describe('syncJiraStatusesToHive', () => {
|
|
|
389
389
|
});
|
|
390
390
|
|
|
391
391
|
describe('syncUnsyncedStoriesToJira', () => {
|
|
392
|
-
let db:
|
|
392
|
+
let db: SqliteProvider;
|
|
393
393
|
let envDir: string;
|
|
394
394
|
|
|
395
395
|
const baseConfig: JiraConfig = {
|
|
@@ -419,18 +419,18 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
beforeEach(async () => {
|
|
422
|
-
db = await createTestDatabase();
|
|
422
|
+
db = new SqliteProvider(await createTestDatabase());
|
|
423
423
|
envDir = mkdtempSync(join(tmpdir(), 'hive-sync-unsynced-test-'));
|
|
424
|
-
db.run(`INSERT INTO agents (id, type, status) VALUES ('manager', 'tech_lead', 'idle')`);
|
|
424
|
+
db.db.run(`INSERT INTO agents (id, type, status) VALUES ('manager', 'tech_lead', 'idle')`);
|
|
425
425
|
});
|
|
426
426
|
|
|
427
427
|
it('returns 0 when all stories already have jira keys', async () => {
|
|
428
|
-
const story = createStory(db, {
|
|
428
|
+
const story = await createStory(db, {
|
|
429
429
|
title: 'Synced Story',
|
|
430
430
|
description: 'Already synced',
|
|
431
431
|
});
|
|
432
432
|
run(
|
|
433
|
-
db,
|
|
433
|
+
db.db,
|
|
434
434
|
'UPDATE stories SET jira_issue_key = ?, external_issue_key = ?, status = ? WHERE id = ?',
|
|
435
435
|
['TEST-1', 'TEST-1', 'planned', story.id]
|
|
436
436
|
);
|
|
@@ -447,7 +447,7 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
447
447
|
});
|
|
448
448
|
|
|
449
449
|
it('skips draft stories without jira keys', async () => {
|
|
450
|
-
createStory(db, {
|
|
450
|
+
await createStory(db, {
|
|
451
451
|
title: 'Draft Story',
|
|
452
452
|
description: 'Still in draft',
|
|
453
453
|
});
|
|
@@ -460,7 +460,7 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
460
460
|
|
|
461
461
|
it('syncs stories without jira keys that have a requirement', async () => {
|
|
462
462
|
// Create a requirement
|
|
463
|
-
run(db, `INSERT INTO requirements (id, title, description, status) VALUES (?, ?, ?, ?)`, [
|
|
463
|
+
run(db.db, `INSERT INTO requirements (id, title, description, status) VALUES (?, ?, ?, ?)`, [
|
|
464
464
|
'REQ-TEST',
|
|
465
465
|
'Test Req',
|
|
466
466
|
'Test requirement',
|
|
@@ -468,7 +468,7 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
468
468
|
]);
|
|
469
469
|
|
|
470
470
|
// Create a team
|
|
471
|
-
run(db, `INSERT INTO teams (id, repo_url, repo_path, name) VALUES (?, ?, ?, ?)`, [
|
|
471
|
+
run(db.db, `INSERT INTO teams (id, repo_url, repo_path, name) VALUES (?, ?, ?, ?)`, [
|
|
472
472
|
'team-test',
|
|
473
473
|
'https://github.com/test/test.git',
|
|
474
474
|
'repos/test',
|
|
@@ -476,13 +476,13 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
476
476
|
]);
|
|
477
477
|
|
|
478
478
|
// Create story without jira key but with requirement and non-draft status
|
|
479
|
-
const story = createStory(db, {
|
|
479
|
+
const story = await createStory(db, {
|
|
480
480
|
requirementId: 'REQ-TEST',
|
|
481
481
|
teamId: 'team-test',
|
|
482
482
|
title: 'Unsynced Story',
|
|
483
483
|
description: 'Needs Jira sync',
|
|
484
484
|
});
|
|
485
|
-
run(db, 'UPDATE stories SET status = ? WHERE id = ?', ['planned', story.id]);
|
|
485
|
+
run(db.db, 'UPDATE stories SET status = ? WHERE id = ?', ['planned', story.id]);
|
|
486
486
|
|
|
487
487
|
const tokenStore = createTestTokenStore({
|
|
488
488
|
JIRA_ACCESS_TOKEN: 'fake-token',
|
|
@@ -511,11 +511,11 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
511
511
|
});
|
|
512
512
|
|
|
513
513
|
it('skips stories without a requirement_id', async () => {
|
|
514
|
-
const story = createStory(db, {
|
|
514
|
+
const story = await createStory(db, {
|
|
515
515
|
title: 'Orphan Story',
|
|
516
516
|
description: 'No requirement',
|
|
517
517
|
});
|
|
518
|
-
run(db, 'UPDATE stories SET status = ? WHERE id = ?', ['planned', story.id]);
|
|
518
|
+
run(db.db, 'UPDATE stories SET status = ? WHERE id = ?', ['planned', story.id]);
|
|
519
519
|
|
|
520
520
|
const tokenStore = createTestTokenStore();
|
|
521
521
|
const synced = await syncUnsyncedStoriesToJira(db, tokenStore, baseConfig);
|
|
@@ -524,7 +524,7 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
524
524
|
|
|
525
525
|
it('re-query guard filters stories that gained jira_issue_key after initial query', async () => {
|
|
526
526
|
// Create a requirement
|
|
527
|
-
run(db, `INSERT INTO requirements (id, title, description, status) VALUES (?, ?, ?, ?)`, [
|
|
527
|
+
run(db.db, `INSERT INTO requirements (id, title, description, status) VALUES (?, ?, ?, ?)`, [
|
|
528
528
|
'REQ-GUARD',
|
|
529
529
|
'Guard Req',
|
|
530
530
|
'Test re-query guard',
|
|
@@ -532,18 +532,18 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
532
532
|
]);
|
|
533
533
|
|
|
534
534
|
// Create TWO stories without jira key
|
|
535
|
-
const story1 = createStory(db, {
|
|
535
|
+
const story1 = await createStory(db, {
|
|
536
536
|
requirementId: 'REQ-GUARD',
|
|
537
537
|
title: 'Story 1 - will get key',
|
|
538
538
|
description: 'Gets key before re-query',
|
|
539
539
|
});
|
|
540
|
-
const story2 = createStory(db, {
|
|
540
|
+
const story2 = await createStory(db, {
|
|
541
541
|
requirementId: 'REQ-GUARD',
|
|
542
542
|
title: 'Story 2 - stays unsynced',
|
|
543
543
|
description: 'Stays without key',
|
|
544
544
|
});
|
|
545
|
-
run(db, 'UPDATE stories SET status = ? WHERE id = ?', ['planned', story1.id]);
|
|
546
|
-
run(db, 'UPDATE stories SET status = ? WHERE id = ?', ['planned', story2.id]);
|
|
545
|
+
run(db.db, 'UPDATE stories SET status = ? WHERE id = ?', ['planned', story1.id]);
|
|
546
|
+
run(db.db, 'UPDATE stories SET status = ? WHERE id = ?', ['planned', story2.id]);
|
|
547
547
|
|
|
548
548
|
const tokenStore = createTestTokenStore({
|
|
549
549
|
JIRA_ACCESS_TOKEN: 'fake-token',
|
|
@@ -558,7 +558,7 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
558
558
|
|
|
559
559
|
// Give story1 a jira key BEFORE calling sync — this means the re-query guard
|
|
560
560
|
// will find it already has a key and filter it out, only passing story2 to sync.
|
|
561
|
-
run(db, 'UPDATE stories SET jira_issue_key = ? WHERE id = ?', ['TEST-999', story1.id]);
|
|
561
|
+
run(db.db, 'UPDATE stories SET jira_issue_key = ? WHERE id = ?', ['TEST-999', story1.id]);
|
|
562
562
|
|
|
563
563
|
vi.mocked(syncRequirementToJira).mockResolvedValue({
|
|
564
564
|
epicKey: 'TEST-100',
|
|
@@ -583,7 +583,7 @@ describe('syncUnsyncedStoriesToJira', () => {
|
|
|
583
583
|
});
|
|
584
584
|
|
|
585
585
|
describe('retrySprintAssignment', () => {
|
|
586
|
-
let db:
|
|
586
|
+
let db: SqliteProvider;
|
|
587
587
|
let envDir: string;
|
|
588
588
|
|
|
589
589
|
const baseConfig: JiraConfig = {
|
|
@@ -613,9 +613,9 @@ describe('retrySprintAssignment', () => {
|
|
|
613
613
|
}
|
|
614
614
|
|
|
615
615
|
beforeEach(async () => {
|
|
616
|
-
db = await createTestDatabase();
|
|
616
|
+
db = new SqliteProvider(await createTestDatabase());
|
|
617
617
|
envDir = mkdtempSync(join(tmpdir(), 'hive-sprint-retry-test-'));
|
|
618
|
-
db.run(`INSERT INTO agents (id, type, status) VALUES ('manager', 'tech_lead', 'idle')`);
|
|
618
|
+
db.db.run(`INSERT INTO agents (id, type, status) VALUES ('manager', 'tech_lead', 'idle')`);
|
|
619
619
|
});
|
|
620
620
|
|
|
621
621
|
it('returns 0 when no stories need sprint assignment', async () => {
|
|
@@ -625,11 +625,11 @@ describe('retrySprintAssignment', () => {
|
|
|
625
625
|
});
|
|
626
626
|
|
|
627
627
|
it('returns 0 when all stories with jira keys are already in sprint', async () => {
|
|
628
|
-
const story = createStory(db, {
|
|
628
|
+
const story = await createStory(db, {
|
|
629
629
|
title: 'Sprint Story',
|
|
630
630
|
description: 'Already in sprint',
|
|
631
631
|
});
|
|
632
|
-
run(db, 'UPDATE stories SET jira_issue_key = ?, in_sprint = 1, status = ? WHERE id = ?', [
|
|
632
|
+
run(db.db, 'UPDATE stories SET jira_issue_key = ?, in_sprint = 1, status = ? WHERE id = ?', [
|
|
633
633
|
'TEST-1',
|
|
634
634
|
'planned',
|
|
635
635
|
story.id,
|
|
@@ -641,11 +641,11 @@ describe('retrySprintAssignment', () => {
|
|
|
641
641
|
});
|
|
642
642
|
|
|
643
643
|
it('retries sprint assignment for stories not in sprint', async () => {
|
|
644
|
-
const story = createStory(db, {
|
|
644
|
+
const story = await createStory(db, {
|
|
645
645
|
title: 'Not In Sprint',
|
|
646
646
|
description: 'Needs sprint assignment',
|
|
647
647
|
});
|
|
648
|
-
run(db, 'UPDATE stories SET jira_issue_key = ?, in_sprint = 0, status = ? WHERE id = ?', [
|
|
648
|
+
run(db.db, 'UPDATE stories SET jira_issue_key = ?, in_sprint = 0, status = ? WHERE id = ?', [
|
|
649
649
|
'TEST-2',
|
|
650
650
|
'planned',
|
|
651
651
|
story.id,
|
|
@@ -671,16 +671,16 @@ describe('retrySprintAssignment', () => {
|
|
|
671
671
|
);
|
|
672
672
|
|
|
673
673
|
// Verify in_sprint was updated
|
|
674
|
-
const updated = getStoryById(db, story.id);
|
|
674
|
+
const updated = await getStoryById(db, story.id);
|
|
675
675
|
expect(updated?.in_sprint).toBe(1);
|
|
676
676
|
});
|
|
677
677
|
|
|
678
678
|
it('returns 0 when sprint move fails', async () => {
|
|
679
|
-
const story = createStory(db, {
|
|
679
|
+
const story = await createStory(db, {
|
|
680
680
|
title: 'Sprint Fail',
|
|
681
681
|
description: 'Sprint move will fail',
|
|
682
682
|
});
|
|
683
|
-
run(db, 'UPDATE stories SET jira_issue_key = ?, in_sprint = 0, status = ? WHERE id = ?', [
|
|
683
|
+
run(db.db, 'UPDATE stories SET jira_issue_key = ?, in_sprint = 0, status = ? WHERE id = ?', [
|
|
684
684
|
'TEST-3',
|
|
685
685
|
'planned',
|
|
686
686
|
story.id,
|
|
@@ -699,16 +699,16 @@ describe('retrySprintAssignment', () => {
|
|
|
699
699
|
expect(count).toBe(0);
|
|
700
700
|
|
|
701
701
|
// Verify in_sprint was NOT updated
|
|
702
|
-
const updated = getStoryById(db, story.id);
|
|
702
|
+
const updated = await getStoryById(db, story.id);
|
|
703
703
|
expect(updated?.in_sprint).toBe(0);
|
|
704
704
|
});
|
|
705
705
|
|
|
706
706
|
it('skips merged stories', async () => {
|
|
707
|
-
const story = createStory(db, {
|
|
707
|
+
const story = await createStory(db, {
|
|
708
708
|
title: 'Merged Story',
|
|
709
709
|
description: 'Already merged',
|
|
710
710
|
});
|
|
711
|
-
run(db, 'UPDATE stories SET jira_issue_key = ?, in_sprint = 0, status = ? WHERE id = ?', [
|
|
711
|
+
run(db.db, 'UPDATE stories SET jira_issue_key = ?, in_sprint = 0, status = ? WHERE id = ?', [
|
|
712
712
|
'TEST-4',
|
|
713
713
|
'merged',
|
|
714
714
|
story.id,
|
|
@@ -721,15 +721,15 @@ describe('retrySprintAssignment', () => {
|
|
|
721
721
|
});
|
|
722
722
|
|
|
723
723
|
describe('idempotency guards', () => {
|
|
724
|
-
let db:
|
|
724
|
+
let db: SqliteProvider;
|
|
725
725
|
|
|
726
726
|
beforeEach(async () => {
|
|
727
|
-
db = await createTestDatabase();
|
|
727
|
+
db = new SqliteProvider(await createTestDatabase());
|
|
728
728
|
});
|
|
729
729
|
|
|
730
|
-
it('unique index prevents duplicate integration_sync records', () => {
|
|
730
|
+
it('unique index prevents duplicate integration_sync records', async () => {
|
|
731
731
|
// Create first sync record
|
|
732
|
-
createSyncRecord(db, {
|
|
732
|
+
await createSyncRecord(db, {
|
|
733
733
|
entityType: 'story',
|
|
734
734
|
entityId: 'STORY-001',
|
|
735
735
|
provider: 'jira',
|
|
@@ -737,18 +737,18 @@ describe('idempotency guards', () => {
|
|
|
737
737
|
});
|
|
738
738
|
|
|
739
739
|
// Attempt to create a duplicate should fail due to unique index
|
|
740
|
-
expect(
|
|
740
|
+
await expect(
|
|
741
741
|
createSyncRecord(db, {
|
|
742
742
|
entityType: 'story',
|
|
743
743
|
entityId: 'STORY-001',
|
|
744
744
|
provider: 'jira',
|
|
745
745
|
externalId: '10002',
|
|
746
746
|
})
|
|
747
|
-
).toThrow();
|
|
747
|
+
).rejects.toThrow();
|
|
748
748
|
});
|
|
749
749
|
|
|
750
|
-
it('allows sync records for different providers on same entity', () => {
|
|
751
|
-
createSyncRecord(db, {
|
|
750
|
+
it('allows sync records for different providers on same entity', async () => {
|
|
751
|
+
await createSyncRecord(db, {
|
|
752
752
|
entityType: 'story',
|
|
753
753
|
entityId: 'STORY-001',
|
|
754
754
|
provider: 'jira',
|
|
@@ -756,19 +756,19 @@ describe('idempotency guards', () => {
|
|
|
756
756
|
});
|
|
757
757
|
|
|
758
758
|
// Different provider should succeed
|
|
759
|
-
expect(
|
|
759
|
+
await expect(
|
|
760
760
|
createSyncRecord(db, {
|
|
761
761
|
entityType: 'story',
|
|
762
762
|
entityId: 'STORY-001',
|
|
763
763
|
provider: 'github',
|
|
764
764
|
externalId: 'gh-001',
|
|
765
765
|
})
|
|
766
|
-
).not.toThrow();
|
|
766
|
+
).resolves.not.toThrow();
|
|
767
767
|
});
|
|
768
768
|
});
|
|
769
769
|
|
|
770
770
|
describe('syncHiveStatusesToJira', () => {
|
|
771
|
-
let db:
|
|
771
|
+
let db: SqliteProvider;
|
|
772
772
|
let envDir: string;
|
|
773
773
|
|
|
774
774
|
const baseConfig: JiraConfig = {
|
|
@@ -799,9 +799,9 @@ describe('syncHiveStatusesToJira', () => {
|
|
|
799
799
|
|
|
800
800
|
beforeEach(async () => {
|
|
801
801
|
vi.clearAllMocks();
|
|
802
|
-
db = await createTestDatabase();
|
|
802
|
+
db = new SqliteProvider(await createTestDatabase());
|
|
803
803
|
envDir = mkdtempSync(join(tmpdir(), 'hive-sync-push-test-'));
|
|
804
|
-
db.run(`INSERT INTO agents (id, type, status) VALUES ('manager', 'tech_lead', 'idle')`);
|
|
804
|
+
db.db.run(`INSERT INTO agents (id, type, status) VALUES ('manager', 'tech_lead', 'idle')`);
|
|
805
805
|
});
|
|
806
806
|
|
|
807
807
|
it('skips push when no status mapping configured', async () => {
|
|
@@ -813,7 +813,7 @@ describe('syncHiveStatusesToJira', () => {
|
|
|
813
813
|
});
|
|
814
814
|
|
|
815
815
|
it('skips stories without Jira issue key', async () => {
|
|
816
|
-
createStory(db, {
|
|
816
|
+
await createStory(db, {
|
|
817
817
|
title: 'Test Story',
|
|
818
818
|
description: 'Test',
|
|
819
819
|
});
|
|
@@ -826,14 +826,14 @@ describe('syncHiveStatusesToJira', () => {
|
|
|
826
826
|
});
|
|
827
827
|
|
|
828
828
|
it('pushes Hive status to Jira when Hive is ahead', async () => {
|
|
829
|
-
const story = createStory(db, {
|
|
829
|
+
const story = await createStory(db, {
|
|
830
830
|
title: 'Test Story',
|
|
831
831
|
description: 'Test',
|
|
832
832
|
});
|
|
833
833
|
|
|
834
834
|
// Story is in_progress in Hive, but Jira still shows planned
|
|
835
835
|
run(
|
|
836
|
-
db,
|
|
836
|
+
db.db,
|
|
837
837
|
'UPDATE stories SET jira_issue_key = ?, external_issue_key = ?, status = ? WHERE id = ?',
|
|
838
838
|
['TEST-123', 'TEST-123', 'in_progress', story.id]
|
|
839
839
|
);
|
|
@@ -904,13 +904,13 @@ describe('syncHiveStatusesToJira', () => {
|
|
|
904
904
|
});
|
|
905
905
|
|
|
906
906
|
it('skips push when Hive status matches Jira status', async () => {
|
|
907
|
-
const story = createStory(db, {
|
|
907
|
+
const story = await createStory(db, {
|
|
908
908
|
title: 'Test Story',
|
|
909
909
|
description: 'Test',
|
|
910
910
|
});
|
|
911
911
|
|
|
912
912
|
run(
|
|
913
|
-
db,
|
|
913
|
+
db.db,
|
|
914
914
|
'UPDATE stories SET jira_issue_key = ?, external_issue_key = ?, status = ? WHERE id = ?',
|
|
915
915
|
['TEST-123', 'TEST-123', 'in_progress', story.id]
|
|
916
916
|
);
|
|
@@ -961,14 +961,14 @@ describe('syncHiveStatusesToJira', () => {
|
|
|
961
961
|
});
|
|
962
962
|
|
|
963
963
|
it('prevents backward transitions when pushing to Jira', async () => {
|
|
964
|
-
const story = createStory(db, {
|
|
964
|
+
const story = await createStory(db, {
|
|
965
965
|
title: 'Test Story',
|
|
966
966
|
description: 'Test',
|
|
967
967
|
});
|
|
968
968
|
|
|
969
969
|
// Hive status is planned, but Jira is already in_progress (ahead)
|
|
970
970
|
run(
|
|
971
|
-
db,
|
|
971
|
+
db.db,
|
|
972
972
|
'UPDATE stories SET jira_issue_key = ?, external_issue_key = ?, status = ? WHERE id = ?',
|
|
973
973
|
['TEST-123', 'TEST-123', 'planned', story.id]
|
|
974
974
|
);
|