edsger 0.50.0 → 0.52.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/.claude/settings.local.json +23 -3
- package/.env.local +12 -0
- package/README.md +25 -25
- package/dist/api/chat.d.ts +7 -7
- package/dist/api/chat.js +13 -13
- package/dist/api/cross-product.d.ts +10 -10
- package/dist/api/cross-product.js +30 -30
- package/dist/api/github.d.ts +5 -5
- package/dist/api/github.js +10 -10
- package/dist/api/intelligence.d.ts +3 -3
- package/dist/api/issues/approval-checker.d.ts +20 -0
- package/dist/api/{features → issues}/approval-checker.js +16 -16
- package/dist/api/issues/get-issue.d.ts +5 -0
- package/dist/api/issues/get-issue.js +21 -0
- package/dist/api/issues/index.d.ts +8 -0
- package/dist/api/issues/index.js +10 -0
- package/dist/api/issues/issue-utils.d.ts +23 -0
- package/dist/api/issues/issue-utils.js +80 -0
- package/dist/api/issues/status-updater.d.ts +41 -0
- package/dist/api/{features → issues}/status-updater.js +23 -23
- package/dist/api/{features → issues}/test-cases.d.ts +7 -7
- package/dist/api/{features → issues}/test-cases.js +12 -12
- package/dist/api/issues/update-issue.d.ts +20 -0
- package/dist/api/{features/update-feature.js → issues/update-issue.js} +22 -22
- package/dist/api/{features → issues}/user-stories.d.ts +5 -5
- package/dist/api/{features → issues}/user-stories.js +8 -8
- package/dist/api/products.d.ts +1 -1
- package/dist/api/tasks.d.ts +1 -1
- package/dist/api/test-reports.d.ts +2 -2
- package/dist/api/test-reports.js +4 -4
- package/dist/auth/login.js +1 -1
- package/dist/commands/agent-workflow/chat-worker.d.ts +7 -7
- package/dist/commands/agent-workflow/chat-worker.js +50 -50
- package/dist/commands/agent-workflow/index.d.ts +2 -2
- package/dist/commands/agent-workflow/index.js +3 -3
- package/dist/commands/agent-workflow/{feature-worker.d.ts → issue-worker.d.ts} +4 -4
- package/dist/commands/agent-workflow/{feature-worker.js → issue-worker.js} +12 -12
- package/dist/commands/agent-workflow/processor.d.ts +9 -9
- package/dist/commands/agent-workflow/processor.js +90 -90
- package/dist/commands/build/index.js +2 -2
- package/dist/commands/find-bugs/index.d.ts +11 -0
- package/dist/commands/find-bugs/index.js +39 -0
- package/dist/commands/find-features/index.d.ts +14 -0
- package/dist/commands/find-features/index.js +42 -0
- package/dist/commands/find-smells/index.d.ts +21 -0
- package/dist/commands/find-smells/index.js +65 -0
- package/dist/commands/init/prompts.js +1 -1
- package/dist/commands/init/templates.d.ts +1 -1
- package/dist/commands/init/templates.js +4 -4
- package/dist/commands/workflow/config/phase-configs.js +17 -17
- package/dist/commands/workflow/core/index.d.ts +1 -1
- package/dist/commands/workflow/core/index.js +2 -2
- package/dist/commands/workflow/core/issue-filter.d.ts +16 -0
- package/dist/commands/workflow/core/issue-filter.js +47 -0
- package/dist/commands/workflow/core/state-manager.d.ts +10 -10
- package/dist/commands/workflow/core/state-manager.js +10 -10
- package/dist/commands/workflow/core/workflow-logger.d.ts +9 -9
- package/dist/commands/workflow/core/workflow-logger.js +21 -21
- package/dist/commands/workflow/executors/phase-executor.d.ts +2 -2
- package/dist/commands/workflow/executors/phase-executor.js +32 -32
- package/dist/commands/workflow/issue-coordinator.d.ts +18 -0
- package/dist/commands/workflow/{feature-coordinator.js → issue-coordinator.js} +29 -29
- package/dist/commands/workflow/phase-orchestrator.d.ts +2 -2
- package/dist/commands/workflow/phase-orchestrator.js +82 -82
- package/dist/commands/workflow/processor.d.ts +7 -7
- package/dist/commands/workflow/processor.js +44 -44
- package/dist/config/{feature-status.d.ts → issue-status.d.ts} +14 -14
- package/dist/config/{feature-status.js → issue-status.js} +14 -14
- package/dist/errors/index.d.ts +6 -6
- package/dist/errors/index.js +11 -11
- package/dist/index.js +90 -1
- package/dist/phases/app-store-generation/context.js +6 -6
- package/dist/phases/app-store-generation/index.js +2 -2
- package/dist/phases/app-store-generation/prompts.js +2 -2
- package/dist/phases/autonomous/index.d.ts +3 -3
- package/dist/phases/autonomous/index.js +37 -37
- package/dist/phases/autonomous/prompts.d.ts +2 -2
- package/dist/phases/autonomous/prompts.js +4 -4
- package/dist/phases/branch-planning/context.d.ts +3 -3
- package/dist/phases/branch-planning/context.js +12 -12
- package/dist/phases/branch-planning/index.d.ts +3 -3
- package/dist/phases/branch-planning/index.js +32 -32
- package/dist/phases/branch-planning/outcome.d.ts +5 -5
- package/dist/phases/branch-planning/outcome.js +12 -12
- package/dist/phases/branch-planning/prompts.d.ts +3 -3
- package/dist/phases/branch-planning/prompts.js +13 -13
- package/dist/phases/bug-fixing/analyzer.d.ts +2 -2
- package/dist/phases/bug-fixing/analyzer.js +13 -13
- package/dist/phases/bug-fixing/context-fetcher.d.ts +3 -3
- package/dist/phases/bug-fixing/context-fetcher.js +18 -18
- package/dist/phases/bug-fixing/mcp-server.js +17 -18
- package/dist/phases/chat-processor/context.d.ts +5 -5
- package/dist/phases/chat-processor/context.js +17 -17
- package/dist/phases/chat-processor/index.d.ts +4 -4
- package/dist/phases/chat-processor/index.js +17 -17
- package/dist/phases/chat-processor/product-context.d.ts +3 -3
- package/dist/phases/chat-processor/product-context.js +16 -16
- package/dist/phases/chat-processor/product-prompts.d.ts +1 -1
- package/dist/phases/chat-processor/product-prompts.js +10 -10
- package/dist/phases/chat-processor/product-tools.d.ts +2 -2
- package/dist/phases/chat-processor/product-tools.js +33 -33
- package/dist/phases/chat-processor/prompts.d.ts +3 -3
- package/dist/phases/chat-processor/prompts.js +22 -22
- package/dist/phases/chat-processor/tools.js +46 -46
- package/dist/phases/code-implementation/branch-pr-creator.d.ts +3 -3
- package/dist/phases/code-implementation/branch-pr-creator.js +5 -5
- package/dist/phases/code-implementation/context.d.ts +3 -3
- package/dist/phases/code-implementation/context.js +18 -18
- package/dist/phases/code-implementation/index.d.ts +4 -4
- package/dist/phases/code-implementation/index.js +88 -88
- package/dist/phases/code-implementation/outcome.d.ts +3 -3
- package/dist/phases/code-implementation/outcome.js +6 -6
- package/dist/phases/code-implementation/prompts.d.ts +1 -1
- package/dist/phases/code-implementation/prompts.js +6 -6
- package/dist/phases/code-implementation-verification/agent.d.ts +3 -3
- package/dist/phases/code-implementation-verification/agent.js +5 -5
- package/dist/phases/code-implementation-verification/index.d.ts +3 -3
- package/dist/phases/code-implementation-verification/index.js +11 -11
- package/dist/phases/code-implementation-verification/prompts.d.ts +3 -3
- package/dist/phases/code-implementation-verification/prompts.js +7 -7
- package/dist/phases/code-refine/context.d.ts +8 -8
- package/dist/phases/code-refine/context.js +29 -29
- package/dist/phases/code-refine/index.d.ts +2 -2
- package/dist/phases/code-refine/index.js +20 -20
- package/dist/phases/code-refine/prompts.d.ts +1 -1
- package/dist/phases/code-refine/prompts.js +3 -3
- package/dist/phases/code-refine/refine-iteration.d.ts +1 -1
- package/dist/phases/code-refine/refine-iteration.js +4 -4
- package/dist/phases/code-refine/retry-handler.js +2 -2
- package/dist/phases/code-refine-verification/index.js +10 -10
- package/dist/phases/code-refine-verification/types.d.ts +2 -2
- package/dist/phases/code-review/context.d.ts +8 -8
- package/dist/phases/code-review/context.js +25 -25
- package/dist/phases/code-review/diff-utils.d.ts +1 -1
- package/dist/phases/code-review/diff-utils.js +1 -1
- package/dist/phases/code-review/index.d.ts +2 -2
- package/dist/phases/code-review/index.js +26 -26
- package/dist/phases/code-testing/analyzer.d.ts +2 -2
- package/dist/phases/code-testing/analyzer.js +18 -18
- package/dist/phases/code-testing/context-fetcher.d.ts +3 -3
- package/dist/phases/code-testing/context-fetcher.js +16 -16
- package/dist/phases/code-testing/prompts.d.ts +1 -1
- package/dist/phases/code-testing/prompts.js +5 -5
- package/dist/phases/find-bugs/index.d.ts +30 -0
- package/dist/phases/find-bugs/index.js +216 -0
- package/dist/phases/find-bugs/prompts.d.ts +22 -0
- package/dist/phases/find-bugs/prompts.js +101 -0
- package/dist/phases/find-bugs/state.d.ts +19 -0
- package/dist/phases/find-bugs/state.js +13 -0
- package/dist/phases/find-bugs/types.d.ts +21 -0
- package/dist/phases/find-bugs/types.js +16 -0
- package/dist/phases/find-features/index.d.ts +40 -0
- package/dist/phases/find-features/index.js +279 -0
- package/dist/phases/find-features/prompts.d.ts +43 -0
- package/dist/phases/find-features/prompts.js +138 -0
- package/dist/phases/find-features/state.d.ts +25 -0
- package/dist/phases/find-features/state.js +22 -0
- package/dist/phases/find-features/types.d.ts +27 -0
- package/dist/phases/find-features/types.js +16 -0
- package/dist/phases/find-shared/git.d.ts +24 -0
- package/dist/phases/find-shared/git.js +60 -0
- package/dist/phases/find-shared/mcp.d.ts +33 -0
- package/dist/phases/find-shared/mcp.js +69 -0
- package/dist/phases/find-shared/scan-state.d.ts +33 -0
- package/dist/phases/find-shared/scan-state.js +112 -0
- package/dist/phases/find-smells/index.d.ts +47 -0
- package/dist/phases/find-smells/index.js +278 -0
- package/dist/phases/find-smells/prompts.d.ts +30 -0
- package/dist/phases/find-smells/prompts.js +129 -0
- package/dist/phases/find-smells/state.d.ts +21 -0
- package/dist/phases/find-smells/state.js +17 -0
- package/dist/phases/find-smells/types.d.ts +51 -0
- package/dist/phases/find-smells/types.js +64 -0
- package/dist/phases/functional-testing/analyzer.d.ts +2 -2
- package/dist/phases/functional-testing/analyzer.js +40 -40
- package/dist/phases/functional-testing/context-fetcher.d.ts +3 -3
- package/dist/phases/functional-testing/context-fetcher.js +16 -16
- package/dist/phases/functional-testing/http-fallback.d.ts +2 -2
- package/dist/phases/functional-testing/http-fallback.js +9 -9
- package/dist/phases/functional-testing/mcp-server.js +23 -24
- package/dist/phases/functional-testing/prompts.d.ts +1 -1
- package/dist/phases/functional-testing/prompts.js +4 -4
- package/dist/phases/functional-testing/test-report-creator.d.ts +2 -2
- package/dist/phases/functional-testing/test-report-creator.js +10 -10
- package/dist/phases/functional-testing/test-retry-handler.js +3 -3
- package/dist/phases/growth-analysis/context.js +6 -6
- package/dist/phases/growth-analysis/index.js +2 -2
- package/dist/phases/growth-analysis/prompts.js +2 -2
- package/dist/phases/intelligence-analysis/context.js +7 -7
- package/dist/phases/intelligence-analysis/index.js +3 -3
- package/dist/phases/{feature-analysis → issue-analysis}/agent.js +1 -1
- package/dist/phases/issue-analysis/context.d.ts +24 -0
- package/dist/phases/{feature-analysis → issue-analysis}/context.js +30 -30
- package/dist/phases/issue-analysis/index.d.ts +8 -0
- package/dist/phases/{feature-analysis → issue-analysis}/index.js +29 -29
- package/dist/phases/issue-analysis/outcome.d.ts +40 -0
- package/dist/phases/{feature-analysis → issue-analysis}/outcome.js +17 -17
- package/dist/phases/{feature-analysis → issue-analysis}/prompts.d.ts +3 -3
- package/dist/phases/{feature-analysis → issue-analysis}/prompts.js +12 -12
- package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/agent.d.ts +2 -2
- package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/agent.js +1 -1
- package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/index.d.ts +5 -5
- package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/index.js +9 -9
- package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/prompts.d.ts +2 -2
- package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/prompts.js +7 -7
- package/dist/phases/output-contracts.js +37 -37
- package/dist/phases/pr-execution/context.d.ts +3 -3
- package/dist/phases/pr-execution/context.js +14 -14
- package/dist/phases/pr-execution/index.d.ts +2 -2
- package/dist/phases/pr-execution/index.js +22 -22
- package/dist/phases/pr-execution/outcome.d.ts +4 -4
- package/dist/phases/pr-execution/outcome.js +6 -6
- package/dist/phases/pr-execution/prompts.d.ts +4 -4
- package/dist/phases/pr-execution/prompts.js +6 -6
- package/dist/phases/pr-resolve/checklist-learner.js +2 -2
- package/dist/phases/pr-review/index.d.ts +1 -1
- package/dist/phases/pr-review/index.js +1 -1
- package/dist/phases/pr-review/prompts.d.ts +1 -1
- package/dist/phases/pr-review/prompts.js +1 -1
- package/dist/phases/pr-shared/context.d.ts +3 -3
- package/dist/phases/pr-shared/context.js +3 -3
- package/dist/phases/pr-splitting/context.d.ts +3 -3
- package/dist/phases/pr-splitting/context.js +16 -16
- package/dist/phases/pr-splitting/index.d.ts +4 -4
- package/dist/phases/pr-splitting/index.js +29 -29
- package/dist/phases/pr-splitting/outcome.d.ts +3 -3
- package/dist/phases/pr-splitting/outcome.js +7 -7
- package/dist/phases/pr-splitting/prompts.d.ts +3 -3
- package/dist/phases/pr-splitting/prompts.js +11 -11
- package/dist/phases/pull-request/creator.d.ts +4 -4
- package/dist/phases/pull-request/creator.js +25 -25
- package/dist/phases/pull-request/handler.d.ts +3 -3
- package/dist/phases/pull-request/handler.js +16 -16
- package/dist/phases/release-sync/index.js +2 -2
- package/dist/phases/run-sheet/agent.js +1 -2
- package/dist/phases/run-sheet/index.js +3 -3
- package/dist/phases/smoke-test/index.js +2 -2
- package/dist/phases/technical-design/context.d.ts +3 -3
- package/dist/phases/technical-design/context.js +11 -11
- package/dist/phases/technical-design/index.d.ts +2 -2
- package/dist/phases/technical-design/index.js +27 -27
- package/dist/phases/technical-design/outcome.d.ts +4 -4
- package/dist/phases/technical-design/outcome.js +6 -6
- package/dist/phases/technical-design/prompts.d.ts +2 -2
- package/dist/phases/technical-design/prompts.js +10 -10
- package/dist/phases/technical-design-verification/agent.d.ts +3 -3
- package/dist/phases/technical-design-verification/agent.js +4 -4
- package/dist/phases/technical-design-verification/index.d.ts +4 -4
- package/dist/phases/technical-design-verification/index.js +12 -12
- package/dist/phases/technical-design-verification/prompts.d.ts +3 -3
- package/dist/phases/technical-design-verification/prompts.js +6 -6
- package/dist/phases/test-cases-analysis/context.d.ts +5 -5
- package/dist/phases/test-cases-analysis/context.js +18 -18
- package/dist/phases/test-cases-analysis/formatters.js +7 -7
- package/dist/phases/test-cases-analysis/index.d.ts +1 -1
- package/dist/phases/test-cases-analysis/index.js +21 -21
- package/dist/phases/test-cases-analysis/outcome.d.ts +7 -7
- package/dist/phases/test-cases-analysis/outcome.js +13 -13
- package/dist/phases/test-cases-analysis/prompts.d.ts +3 -3
- package/dist/phases/test-cases-analysis/prompts.js +6 -6
- package/dist/phases/user-stories-analysis/context.d.ts +5 -5
- package/dist/phases/user-stories-analysis/context.js +18 -18
- package/dist/phases/user-stories-analysis/formatters.js +7 -7
- package/dist/phases/user-stories-analysis/index.d.ts +1 -1
- package/dist/phases/user-stories-analysis/index.js +21 -21
- package/dist/phases/user-stories-analysis/outcome.d.ts +7 -7
- package/dist/phases/user-stories-analysis/outcome.js +13 -13
- package/dist/phases/user-stories-analysis/prompts.d.ts +3 -3
- package/dist/phases/user-stories-analysis/prompts.js +10 -10
- package/dist/services/audit-logs.d.ts +10 -10
- package/dist/services/audit-logs.js +12 -12
- package/dist/services/branches.d.ts +6 -6
- package/dist/services/branches.js +16 -16
- package/dist/services/checklist.d.ts +3 -3
- package/dist/services/checklist.js +11 -11
- package/dist/services/coaching/coaching-agent.js +2 -2
- package/dist/services/coaching/coaching-loop.d.ts +1 -1
- package/dist/services/coaching/coaching-loop.js +2 -2
- package/dist/services/coaching/phase-coaching.d.ts +2 -2
- package/dist/services/coaching/phase-coaching.js +3 -3
- package/dist/services/coaching/self-rating.js +1 -1
- package/dist/services/feedbacks.d.ts +4 -4
- package/dist/services/feedbacks.js +8 -8
- package/dist/services/phase-hooks/bindings-fetcher.d.ts +4 -4
- package/dist/services/phase-hooks/bindings-fetcher.js +8 -8
- package/dist/services/phase-hooks/hook-executor.js +1 -1
- package/dist/services/phase-hooks/hook-logging.d.ts +2 -2
- package/dist/services/phase-hooks/hook-logging.js +4 -4
- package/dist/services/phase-hooks/hook-runner.d.ts +1 -1
- package/dist/services/phase-hooks/hook-runner.js +4 -4
- package/dist/services/phase-hooks/types.d.ts +3 -3
- package/dist/services/phase-ratings.d.ts +7 -7
- package/dist/services/phase-ratings.js +8 -8
- package/dist/services/pull-requests.d.ts +4 -4
- package/dist/services/pull-requests.js +11 -11
- package/dist/services/skill-resolver.d.ts +1 -1
- package/dist/services/skill-resolver.js +1 -1
- package/dist/skills/phase/app-store-generation/SKILL.md +9 -9
- package/dist/skills/phase/autonomous/SKILL.md +2 -2
- package/dist/skills/phase/branch-planning/SKILL.md +12 -12
- package/dist/skills/phase/bug-fixing/SKILL.md +1 -1
- package/dist/skills/phase/code-implementation/SKILL.md +6 -6
- package/dist/skills/phase/code-implementation-verification/SKILL.md +3 -3
- package/dist/skills/phase/code-testing/SKILL.md +5 -5
- package/dist/skills/phase/functional-testing/SKILL.md +3 -3
- package/dist/skills/phase/growth-analysis/SKILL.md +8 -8
- package/dist/skills/phase/incremental-sync/SKILL.md +6 -6
- package/dist/skills/phase/intelligence-analysis/SKILL.md +7 -7
- package/dist/skills/phase/{feature-analysis → issue-analysis}/SKILL.md +8 -8
- package/dist/skills/phase/pr-execution/SKILL.md +7 -7
- package/dist/skills/phase/pr-splitting/SKILL.md +14 -14
- package/dist/skills/phase/smoke-test/SKILL.md +1 -1
- package/dist/skills/phase/technical-design/SKILL.md +5 -5
- package/dist/skills/phase/test-cases-analysis/SKILL.md +4 -4
- package/dist/skills/phase/user-stories-analysis/SKILL.md +13 -13
- package/dist/system/session-manager.d.ts +3 -3
- package/dist/system/session-manager.js +3 -3
- package/dist/system/sleep-notification.js +2 -2
- package/dist/system/sleep-prevention.js +1 -1
- package/dist/types/index.d.ts +21 -21
- package/dist/types/{features.d.ts → issues.d.ts} +3 -3
- package/dist/types/pipeline.d.ts +4 -4
- package/dist/updater/auto-updater.d.ts +2 -2
- package/dist/updater/auto-updater.js +3 -3
- package/dist/utils/conflict-resolver.d.ts +1 -1
- package/dist/utils/conflict-resolver.js +5 -5
- package/dist/utils/formatters.d.ts +4 -4
- package/dist/utils/formatters.js +29 -29
- package/dist/utils/git-branch-manager-async.d.ts +6 -6
- package/dist/utils/git-branch-manager-async.js +41 -41
- package/dist/utils/git-branch-manager.d.ts +11 -11
- package/dist/utils/git-branch-manager.js +42 -42
- package/dist/utils/image-downloader.d.ts +4 -4
- package/dist/utils/image-downloader.js +17 -17
- package/dist/utils/pipeline-logger.d.ts +1 -1
- package/dist/utils/pipeline-logger.js +5 -5
- package/dist/workspace/workspace-manager.d.ts +17 -17
- package/dist/workspace/workspace-manager.js +21 -21
- package/package.json +1 -1
- package/vitest.config.ts +4 -0
- package/dist/api/__tests__/app-store.test.d.ts +0 -7
- package/dist/api/__tests__/app-store.test.js +0 -60
- package/dist/api/__tests__/intelligence.test.d.ts +0 -11
- package/dist/api/__tests__/intelligence.test.js +0 -315
- package/dist/api/features/__tests__/feature-utils.test.d.ts +0 -4
- package/dist/api/features/__tests__/feature-utils.test.js +0 -370
- package/dist/api/features/__tests__/status-updater.test.d.ts +0 -4
- package/dist/api/features/__tests__/status-updater.test.js +0 -88
- package/dist/api/features/approval-checker.d.ts +0 -20
- package/dist/api/features/feature-utils.d.ts +0 -23
- package/dist/api/features/feature-utils.js +0 -80
- package/dist/api/features/get-feature.d.ts +0 -5
- package/dist/api/features/get-feature.js +0 -21
- package/dist/api/features/index.d.ts +0 -8
- package/dist/api/features/index.js +0 -10
- package/dist/api/features/status-updater.d.ts +0 -41
- package/dist/api/features/update-feature.d.ts +0 -20
- package/dist/commands/build/__tests__/build.test.d.ts +0 -5
- package/dist/commands/build/__tests__/build.test.js +0 -206
- package/dist/commands/build/__tests__/detect-project.test.d.ts +0 -6
- package/dist/commands/build/__tests__/detect-project.test.js +0 -160
- package/dist/commands/build/__tests__/run-build.test.d.ts +0 -6
- package/dist/commands/build/__tests__/run-build.test.js +0 -433
- package/dist/commands/intelligence/__tests__/command.test.d.ts +0 -4
- package/dist/commands/intelligence/__tests__/command.test.js +0 -48
- package/dist/commands/workflow/core/__tests__/feature-filter.test.d.ts +0 -5
- package/dist/commands/workflow/core/__tests__/feature-filter.test.js +0 -316
- package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.d.ts +0 -4
- package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.js +0 -397
- package/dist/commands/workflow/core/__tests__/state-manager.test.d.ts +0 -4
- package/dist/commands/workflow/core/__tests__/state-manager.test.js +0 -384
- package/dist/commands/workflow/core/feature-filter.d.ts +0 -16
- package/dist/commands/workflow/core/feature-filter.js +0 -47
- package/dist/commands/workflow/feature-coordinator.d.ts +0 -18
- package/dist/config/__tests__/config.test.d.ts +0 -4
- package/dist/config/__tests__/config.test.js +0 -286
- package/dist/config/__tests__/feature-status.test.d.ts +0 -4
- package/dist/config/__tests__/feature-status.test.js +0 -111
- package/dist/errors/__tests__/index.test.d.ts +0 -4
- package/dist/errors/__tests__/index.test.js +0 -349
- package/dist/phases/app-store-generation/__tests__/agent.test.d.ts +0 -5
- package/dist/phases/app-store-generation/__tests__/agent.test.js +0 -142
- package/dist/phases/app-store-generation/__tests__/context.test.d.ts +0 -4
- package/dist/phases/app-store-generation/__tests__/context.test.js +0 -284
- package/dist/phases/app-store-generation/__tests__/prompts.test.d.ts +0 -4
- package/dist/phases/app-store-generation/__tests__/prompts.test.js +0 -122
- package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.d.ts +0 -5
- package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.js +0 -826
- package/dist/phases/code-review/__tests__/diff-utils.test.js +0 -101
- package/dist/phases/feature-analysis/context.d.ts +0 -24
- package/dist/phases/feature-analysis/index.d.ts +0 -8
- package/dist/phases/feature-analysis/outcome.d.ts +0 -40
- package/dist/phases/intelligence-analysis/__tests__/context.test.d.ts +0 -4
- package/dist/phases/intelligence-analysis/__tests__/context.test.js +0 -192
- package/dist/phases/intelligence-analysis/__tests__/matching.test.d.ts +0 -13
- package/dist/phases/intelligence-analysis/__tests__/matching.test.js +0 -154
- package/dist/phases/intelligence-analysis/__tests__/orchestration.test.d.ts +0 -5
- package/dist/phases/intelligence-analysis/__tests__/orchestration.test.js +0 -378
- package/dist/phases/intelligence-analysis/__tests__/prompts.test.d.ts +0 -4
- package/dist/phases/intelligence-analysis/__tests__/prompts.test.js +0 -33
- package/dist/phases/pr-execution/__tests__/file-assigner.test.d.ts +0 -1
- package/dist/phases/pr-execution/__tests__/file-assigner.test.js +0 -303
- package/dist/phases/pr-resolve/__tests__/checklist-learner.test.d.ts +0 -1
- package/dist/phases/pr-resolve/__tests__/checklist-learner.test.js +0 -157
- package/dist/phases/pr-resolve/__tests__/prompts.test.d.ts +0 -1
- package/dist/phases/pr-resolve/__tests__/prompts.test.js +0 -116
- package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.d.ts +0 -1
- package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.js +0 -138
- package/dist/phases/pr-resolve/__tests__/types.test.d.ts +0 -1
- package/dist/phases/pr-resolve/__tests__/types.test.js +0 -43
- package/dist/phases/pr-resolve/__tests__/workspace.test.d.ts +0 -1
- package/dist/phases/pr-resolve/__tests__/workspace.test.js +0 -111
- package/dist/phases/pr-review/__tests__/prompts.test.d.ts +0 -1
- package/dist/phases/pr-review/__tests__/prompts.test.js +0 -49
- package/dist/phases/pr-review/__tests__/review-comments.test.d.ts +0 -1
- package/dist/phases/pr-review/__tests__/review-comments.test.js +0 -110
- package/dist/phases/pr-shared/__tests__/agent-utils.test.d.ts +0 -1
- package/dist/phases/pr-shared/__tests__/agent-utils.test.js +0 -91
- package/dist/phases/pr-shared/__tests__/context.test.d.ts +0 -1
- package/dist/phases/pr-shared/__tests__/context.test.js +0 -94
- package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.d.ts +0 -1
- package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.js +0 -331
- package/dist/phases/run-sheet/render.d.ts +0 -60
- package/dist/phases/run-sheet/render.js +0 -297
- package/dist/phases/smoke-test/__tests__/agent.test.d.ts +0 -4
- package/dist/phases/smoke-test/__tests__/agent.test.js +0 -84
- package/dist/phases/smoke-test/__tests__/github.test.d.ts +0 -9
- package/dist/phases/smoke-test/__tests__/github.test.js +0 -120
- package/dist/phases/smoke-test/__tests__/snapshot.test.d.ts +0 -8
- package/dist/phases/smoke-test/__tests__/snapshot.test.js +0 -93
- package/dist/phases/smoke-test/github.d.ts +0 -54
- package/dist/phases/smoke-test/github.js +0 -101
- package/dist/phases/smoke-test/snapshot.d.ts +0 -27
- package/dist/phases/smoke-test/snapshot.js +0 -157
- package/dist/services/coaching/__tests__/coaching-agent.test.d.ts +0 -1
- package/dist/services/coaching/__tests__/coaching-agent.test.js +0 -74
- package/dist/services/coaching/__tests__/coaching-loop.test.d.ts +0 -1
- package/dist/services/coaching/__tests__/coaching-loop.test.js +0 -59
- package/dist/services/coaching/__tests__/self-rating.test.d.ts +0 -1
- package/dist/services/coaching/__tests__/self-rating.test.js +0 -188
- package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.d.ts +0 -4
- package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.js +0 -133
- package/dist/services/lifecycle-agent/__tests__/transition-rules.test.d.ts +0 -4
- package/dist/services/lifecycle-agent/__tests__/transition-rules.test.js +0 -336
- package/dist/services/lifecycle-agent/index.d.ts +0 -24
- package/dist/services/lifecycle-agent/index.js +0 -25
- package/dist/services/lifecycle-agent/phase-criteria.d.ts +0 -57
- package/dist/services/lifecycle-agent/phase-criteria.js +0 -335
- package/dist/services/lifecycle-agent/transition-rules.d.ts +0 -60
- package/dist/services/lifecycle-agent/transition-rules.js +0 -184
- package/dist/services/lifecycle-agent/types.d.ts +0 -190
- package/dist/services/lifecycle-agent/types.js +0 -12
- package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.d.ts +0 -1
- package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.js +0 -122
- package/dist/services/phase-hooks/__tests__/hook-executor.test.d.ts +0 -1
- package/dist/services/phase-hooks/__tests__/hook-executor.test.js +0 -321
- package/dist/services/phase-hooks/__tests__/hook-runner.test.d.ts +0 -1
- package/dist/services/phase-hooks/__tests__/hook-runner.test.js +0 -261
- package/dist/services/phase-hooks/__tests__/plugin-loader.test.d.ts +0 -1
- package/dist/services/phase-hooks/__tests__/plugin-loader.test.js +0 -158
- package/dist/services/video/__tests__/video-pipeline.test.d.ts +0 -6
- package/dist/services/video/__tests__/video-pipeline.test.js +0 -249
- package/dist/types/features.js +0 -1
- package/dist/workspace/__tests__/workspace-manager.test.d.ts +0 -7
- package/dist/workspace/__tests__/workspace-manager.test.js +0 -52
- /package/dist/api/{features → issues}/batch-operations.d.ts +0 -0
- /package/dist/api/{features → issues}/batch-operations.js +0 -0
- /package/dist/phases/{feature-analysis → issue-analysis}/agent.d.ts +0 -0
- /package/dist/skills/phase/{feature-analysis-verification → issue-analysis-verification}/SKILL.md +0 -0
- /package/dist/{phases/code-review/__tests__/diff-utils.test.d.ts → types/issues.js} +0 -0
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Autonomous Development Phase
|
|
3
3
|
*
|
|
4
4
|
* Runs a time-limited loop where Claude Code SDK analyzes the codebase,
|
|
5
|
-
* decides the next actionable step toward the
|
|
5
|
+
* decides the next actionable step toward the issue's objective (description),
|
|
6
6
|
* implements it, and commits. All iterations build on the same branch.
|
|
7
7
|
* A PR is created after the first iteration; subsequent pushes update it.
|
|
8
8
|
*/
|
|
9
9
|
import { query } from '@anthropic-ai/claude-agent-sdk';
|
|
10
|
-
import { getFeature } from '../../api/features/get-feature.js';
|
|
11
10
|
import { getGitHubConfig } from '../../api/github.js';
|
|
11
|
+
import { getIssue } from '../../api/issues/get-issue.js';
|
|
12
12
|
import { DEFAULT_MODEL } from '../../constants.js';
|
|
13
|
-
import {
|
|
13
|
+
import { logIssuePhaseEvent } from '../../services/audit-logs.js';
|
|
14
14
|
import { createBranches, getCurrentBranch, updateBranch, } from '../../services/branches.js';
|
|
15
15
|
import { prepareCustomBranchGitEnvironmentAsync, resetUncommittedChanges, } from '../../utils/git-branch-manager.js';
|
|
16
16
|
import { gitPush } from '../../utils/git-push.js';
|
|
@@ -55,9 +55,9 @@ async function* prompt(userPrompt) {
|
|
|
55
55
|
/**
|
|
56
56
|
* Run a single autonomous iteration using Claude Code SDK
|
|
57
57
|
*/
|
|
58
|
-
async function runIteration(
|
|
59
|
-
const systemPrompt = await createAutonomousSystemPrompt(
|
|
60
|
-
const userPromptText = createAutonomousUserPrompt(
|
|
58
|
+
async function runIteration(issueId, issueDescription, config, verbose) {
|
|
59
|
+
const systemPrompt = await createAutonomousSystemPrompt(issueId);
|
|
60
|
+
const userPromptText = createAutonomousUserPrompt(issueDescription);
|
|
61
61
|
let lastAssistantResponse = '';
|
|
62
62
|
for await (const message of query({
|
|
63
63
|
prompt: prompt(userPromptText),
|
|
@@ -128,9 +128,9 @@ function parseIterationResult(responseText) {
|
|
|
128
128
|
* Handle a successful iteration: push, create PR, and log
|
|
129
129
|
*/
|
|
130
130
|
async function handleSuccessfulIteration(opts) {
|
|
131
|
-
const {
|
|
131
|
+
const { issueId, devBranchName, currentBranch, iterationResult, totalIterations, iterationDuration, startTime, endTime, existingPrUrl, verbose, } = opts;
|
|
132
132
|
// Get GitHub config for push authentication and PR creation
|
|
133
|
-
const githubConfig = await getGitHubConfig(
|
|
133
|
+
const githubConfig = await getGitHubConfig(issueId, verbose);
|
|
134
134
|
// Push to remote with authentication
|
|
135
135
|
const pushResult = gitPush({
|
|
136
136
|
branchName: devBranchName,
|
|
@@ -148,8 +148,8 @@ async function handleSuccessfulIteration(opts) {
|
|
|
148
148
|
({ prUrl, prNumber } = prInfo);
|
|
149
149
|
}
|
|
150
150
|
// Log iteration completion to audit logs
|
|
151
|
-
await
|
|
152
|
-
|
|
151
|
+
await logIssuePhaseEvent({
|
|
152
|
+
issueId,
|
|
153
153
|
eventType: 'autonomous_iteration_completed',
|
|
154
154
|
phase: 'autonomous',
|
|
155
155
|
result: 'success',
|
|
@@ -207,7 +207,7 @@ githubConfig, devBranchName, currentBranch, verbose) {
|
|
|
207
207
|
* Handle a failed iteration: reset and log
|
|
208
208
|
*/
|
|
209
209
|
async function handleFailedIteration(opts) {
|
|
210
|
-
const {
|
|
210
|
+
const { issueId, totalIterations, iterationDuration, startTime, endTime, verbose, } = opts;
|
|
211
211
|
logError(`❌ Iteration ${totalIterations} failed`);
|
|
212
212
|
try {
|
|
213
213
|
resetUncommittedChanges(verbose);
|
|
@@ -215,8 +215,8 @@ async function handleFailedIteration(opts) {
|
|
|
215
215
|
catch {
|
|
216
216
|
// Ignore cleanup errors
|
|
217
217
|
}
|
|
218
|
-
await
|
|
219
|
-
|
|
218
|
+
await logIssuePhaseEvent({
|
|
219
|
+
issueId,
|
|
220
220
|
eventType: 'autonomous_iteration_failed',
|
|
221
221
|
phase: 'autonomous',
|
|
222
222
|
result: 'error',
|
|
@@ -235,27 +235,27 @@ async function handleFailedIteration(opts) {
|
|
|
235
235
|
*/
|
|
236
236
|
// eslint-disable-next-line complexity -- orchestration function coordinating autonomous development lifecycle
|
|
237
237
|
export async function runAutonomousDevelopment(options, config, _checklistContext) {
|
|
238
|
-
const {
|
|
238
|
+
const { issueId, verbose } = options;
|
|
239
239
|
const startTime = Date.now();
|
|
240
|
-
logInfo(`\n🤖 Starting autonomous development for
|
|
241
|
-
// 1. Fetch
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
const autonomousHours =
|
|
245
|
-
if (!
|
|
240
|
+
logInfo(`\n🤖 Starting autonomous development for issue: ${issueId}`);
|
|
241
|
+
// 1. Fetch issue info to get description (= objective) and autonomous_hours
|
|
242
|
+
const issue = await getIssue(issueId, verbose);
|
|
243
|
+
const issueDescription = issue.description || '';
|
|
244
|
+
const autonomousHours = issue.autonomous_hours || 4;
|
|
245
|
+
if (!issueDescription) {
|
|
246
246
|
return {
|
|
247
|
-
|
|
247
|
+
issueId,
|
|
248
248
|
status: 'error',
|
|
249
|
-
message: '
|
|
249
|
+
message: 'Issue description is required for autonomous mode (it serves as the objective)',
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
252
|
const endTime = startTime + autonomousHours * 3600000;
|
|
253
253
|
logInfo(`⏰ Autonomous mode will run for ${autonomousHours} hour(s)`);
|
|
254
|
-
logInfo(`🎯 Objective: ${truncateText(
|
|
254
|
+
logInfo(`🎯 Objective: ${truncateText(issueDescription.replace(/<[^>]*>/g, ''), 200)}`);
|
|
255
255
|
// 2. Get or create branch
|
|
256
256
|
let currentBranch = null;
|
|
257
257
|
try {
|
|
258
|
-
currentBranch = await getCurrentBranch({
|
|
258
|
+
currentBranch = await getCurrentBranch({ issueId, verbose });
|
|
259
259
|
}
|
|
260
260
|
catch {
|
|
261
261
|
if (verbose) {
|
|
@@ -263,12 +263,12 @@ export async function runAutonomousDevelopment(options, config, _checklistContex
|
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
if (!currentBranch) {
|
|
266
|
-
const
|
|
267
|
-
const defaultBranchName = `dev/${
|
|
268
|
-
const createdBranches = await createBranches({
|
|
266
|
+
const issueName = truncateText(issue.name || 'Autonomous Development', 100);
|
|
267
|
+
const defaultBranchName = `dev/${issueId}`;
|
|
268
|
+
const createdBranches = await createBranches({ issueId, verbose }, [
|
|
269
269
|
{
|
|
270
|
-
name:
|
|
271
|
-
description: `Autonomous development branch for: ${
|
|
270
|
+
name: issueName,
|
|
271
|
+
description: `Autonomous development branch for: ${issueName}`,
|
|
272
272
|
branch_name: defaultBranchName,
|
|
273
273
|
status: 'pending',
|
|
274
274
|
},
|
|
@@ -282,12 +282,12 @@ export async function runAutonomousDevelopment(options, config, _checklistContex
|
|
|
282
282
|
}
|
|
283
283
|
if (!currentBranch) {
|
|
284
284
|
return {
|
|
285
|
-
|
|
285
|
+
issueId,
|
|
286
286
|
status: 'error',
|
|
287
287
|
message: 'Failed to create or find a branch for autonomous development',
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
const devBranchName = currentBranch.branch_name || `dev/${
|
|
290
|
+
const devBranchName = currentBranch.branch_name || `dev/${issueId}`;
|
|
291
291
|
// 3. Update branch status to in_progress
|
|
292
292
|
if (currentBranch.status === 'pending') {
|
|
293
293
|
try {
|
|
@@ -301,7 +301,7 @@ export async function runAutonomousDevelopment(options, config, _checklistContex
|
|
|
301
301
|
}
|
|
302
302
|
// 4. Prepare git environment (checkout branch + rebase with main)
|
|
303
303
|
const { cleanup: cleanupGit } = await prepareCustomBranchGitEnvironmentAsync({
|
|
304
|
-
|
|
304
|
+
issueBranch: devBranchName,
|
|
305
305
|
baseBranch: 'main',
|
|
306
306
|
verbose,
|
|
307
307
|
resolveConflicts: true,
|
|
@@ -319,13 +319,13 @@ export async function runAutonomousDevelopment(options, config, _checklistContex
|
|
|
319
319
|
const iterationStart = Date.now();
|
|
320
320
|
logInfo(`\n${'='.repeat(60)}\n🔄 Autonomous iteration ${totalIterations}\n${'='.repeat(60)}`);
|
|
321
321
|
// Run iteration
|
|
322
|
-
const iterationResult = await runIteration(
|
|
322
|
+
const iterationResult = await runIteration(issueId, issueDescription, config, verbose);
|
|
323
323
|
const iterationDuration = Date.now() - iterationStart;
|
|
324
324
|
logInfo(`⏱️ Iteration ${totalIterations} took ${(iterationDuration / 1000).toFixed(0)}s`);
|
|
325
325
|
if (iterationResult.success) {
|
|
326
326
|
logInfo(`✅ Iteration ${totalIterations}: ${iterationResult.summary || 'completed'}`);
|
|
327
327
|
const prInfo = await handleSuccessfulIteration({
|
|
328
|
-
|
|
328
|
+
issueId,
|
|
329
329
|
devBranchName,
|
|
330
330
|
currentBranch,
|
|
331
331
|
iterationResult,
|
|
@@ -341,7 +341,7 @@ export async function runAutonomousDevelopment(options, config, _checklistContex
|
|
|
341
341
|
}
|
|
342
342
|
else {
|
|
343
343
|
await handleFailedIteration({
|
|
344
|
-
|
|
344
|
+
issueId,
|
|
345
345
|
totalIterations,
|
|
346
346
|
iterationDuration,
|
|
347
347
|
startTime,
|
|
@@ -382,7 +382,7 @@ export async function runAutonomousDevelopment(options, config, _checklistContex
|
|
|
382
382
|
}
|
|
383
383
|
logInfo(`${'='.repeat(60)}\n`);
|
|
384
384
|
return {
|
|
385
|
-
|
|
385
|
+
issueId,
|
|
386
386
|
status: 'success',
|
|
387
387
|
message: `Autonomous development completed: ${totalIterations} iterations in ${elapsedHours.toFixed(2)} hours`,
|
|
388
388
|
branchName: devBranchName,
|
|
@@ -395,7 +395,7 @@ export async function runAutonomousDevelopment(options, config, _checklistContex
|
|
|
395
395
|
const elapsedHours = (Date.now() - startTime) / 3600000;
|
|
396
396
|
logError(`Autonomous development failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
397
397
|
return {
|
|
398
|
-
|
|
398
|
+
issueId,
|
|
399
399
|
status: 'error',
|
|
400
400
|
message: `Autonomous development failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
401
401
|
branchName: devBranchName,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Prompts for the autonomous development phase
|
|
3
3
|
*/
|
|
4
|
-
export declare const createAutonomousSystemPrompt: (
|
|
5
|
-
export declare function createAutonomousUserPrompt(
|
|
4
|
+
export declare const createAutonomousSystemPrompt: (issueId: string, projectDir?: string) => Promise<string>;
|
|
5
|
+
export declare function createAutonomousUserPrompt(issueDescription: string): string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { resolveSkill, substituteVariables, } from '../../services/skill-resolver.js';
|
|
5
5
|
import { OUTPUT_CONTRACTS } from '../output-contracts.js';
|
|
6
|
-
export const createAutonomousSystemPrompt = async (
|
|
6
|
+
export const createAutonomousSystemPrompt = async (issueId, projectDir) => {
|
|
7
7
|
const skill = await resolveSkill('phase/autonomous', {
|
|
8
8
|
projectDir,
|
|
9
9
|
});
|
|
@@ -11,15 +11,15 @@ export const createAutonomousSystemPrompt = async (featureId, projectDir) => {
|
|
|
11
11
|
throw new Error('Failed to load skill: phase/autonomous');
|
|
12
12
|
}
|
|
13
13
|
let { prompt } = skill;
|
|
14
|
-
prompt = substituteVariables(prompt, {
|
|
14
|
+
prompt = substituteVariables(prompt, { ISSUE_ID: issueId });
|
|
15
15
|
return `${prompt}
|
|
16
16
|
|
|
17
17
|
${OUTPUT_CONTRACTS['autonomous']}`;
|
|
18
18
|
};
|
|
19
|
-
export function createAutonomousUserPrompt(
|
|
19
|
+
export function createAutonomousUserPrompt(issueDescription) {
|
|
20
20
|
return `## Objective
|
|
21
21
|
|
|
22
|
-
${
|
|
22
|
+
${issueDescription}
|
|
23
23
|
|
|
24
24
|
## Instructions
|
|
25
25
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ProductInfo } from '../../api/products.js';
|
|
2
2
|
import { type Branch } from '../../services/branches.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IssueInfo, TestCase, UserStory } from '../../types/issues.js';
|
|
4
4
|
export interface BranchPlanningContext {
|
|
5
|
-
|
|
5
|
+
issue: IssueInfo;
|
|
6
6
|
product: ProductInfo;
|
|
7
7
|
user_stories: UserStory[];
|
|
8
8
|
test_cases: TestCase[];
|
|
@@ -11,4 +11,4 @@ export interface BranchPlanningContext {
|
|
|
11
11
|
/**
|
|
12
12
|
* Fetch all context information needed for branch planning via MCP endpoints
|
|
13
13
|
*/
|
|
14
|
-
export declare function fetchBranchPlanningContext(
|
|
14
|
+
export declare function fetchBranchPlanningContext(issueId: string, verbose?: boolean): Promise<BranchPlanningContext>;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getIssue, getTestCases, getUserStories, } from '../../api/issues/index.js';
|
|
2
2
|
import { getProduct } from '../../api/products.js';
|
|
3
3
|
import { getBranches } from '../../services/branches.js';
|
|
4
4
|
import { logError, logInfo } from '../../utils/logger.js';
|
|
5
5
|
/**
|
|
6
6
|
* Fetch all context information needed for branch planning via MCP endpoints
|
|
7
7
|
*/
|
|
8
|
-
export async function fetchBranchPlanningContext(
|
|
8
|
+
export async function fetchBranchPlanningContext(issueId, verbose) {
|
|
9
9
|
try {
|
|
10
10
|
if (verbose) {
|
|
11
|
-
logInfo(`Fetching branch planning context for
|
|
11
|
+
logInfo(`Fetching branch planning context for issue: ${issueId}`);
|
|
12
12
|
}
|
|
13
13
|
// Fetch all required data in parallel for better performance
|
|
14
|
-
const [
|
|
15
|
-
|
|
16
|
-
getUserStories(
|
|
17
|
-
getTestCases(
|
|
18
|
-
getBranches({
|
|
14
|
+
const [issue, userStories, testCases, existingBranches] = await Promise.all([
|
|
15
|
+
getIssue(issueId, verbose),
|
|
16
|
+
getUserStories(issueId, verbose),
|
|
17
|
+
getTestCases(issueId, verbose),
|
|
18
|
+
getBranches({ issueId, verbose }).catch(() => []),
|
|
19
19
|
]);
|
|
20
|
-
const product = await getProduct(
|
|
20
|
+
const product = await getProduct(issue.product_id, verbose);
|
|
21
21
|
if (verbose) {
|
|
22
22
|
logInfo(`✅ Branch planning context fetched successfully:`);
|
|
23
|
-
logInfo(`
|
|
23
|
+
logInfo(` Issue: ${issue.name}`);
|
|
24
24
|
logInfo(` Product: ${product.name}`);
|
|
25
25
|
logInfo(` User Stories: ${userStories.length}`);
|
|
26
26
|
logInfo(` Test Cases: ${testCases.length}`);
|
|
27
|
-
logInfo(` Technical Design: ${
|
|
27
|
+
logInfo(` Technical Design: ${issue.technical_design ? 'Yes' : 'No'}`);
|
|
28
28
|
logInfo(` Existing Branches: ${existingBranches.length}`);
|
|
29
29
|
}
|
|
30
30
|
return {
|
|
31
|
-
|
|
31
|
+
issue,
|
|
32
32
|
product,
|
|
33
33
|
user_stories: userStories,
|
|
34
34
|
test_cases: testCases,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EdsgerConfig } from '../../types/index.js';
|
|
2
2
|
export interface BranchPlanningOptions {
|
|
3
|
-
|
|
3
|
+
issueId: string;
|
|
4
4
|
verbose?: boolean;
|
|
5
5
|
replaceExisting?: boolean;
|
|
6
6
|
}
|
|
@@ -14,12 +14,12 @@ export interface PlannedBranch {
|
|
|
14
14
|
acceptance_criteria?: string[];
|
|
15
15
|
}
|
|
16
16
|
export interface BranchPlanningResult {
|
|
17
|
-
|
|
17
|
+
issueId: string;
|
|
18
18
|
branches: PlannedBranch[];
|
|
19
19
|
status: 'success' | 'error';
|
|
20
20
|
summary: string;
|
|
21
21
|
rationale?: string;
|
|
22
22
|
}
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const planIssueBranches: (options: BranchPlanningOptions, config: EdsgerConfig) => Promise<BranchPlanningResult>;
|
|
24
24
|
export type { BranchPlanningContext } from './context.js';
|
|
25
25
|
export { fetchBranchPlanningContext } from './context.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { query } from '@anthropic-ai/claude-agent-sdk';
|
|
2
2
|
import { DEFAULT_MODEL } from '../../constants.js';
|
|
3
|
-
import {
|
|
3
|
+
import { logIssuePhaseEvent } from '../../services/audit-logs.js';
|
|
4
4
|
import { clearBranches, createBranches, } from '../../services/branches.js';
|
|
5
5
|
import { formatFeedbacksForContext, getFeedbacksForPhase, } from '../../services/feedbacks.js';
|
|
6
6
|
import { logDebug, logError, logInfo } from '../../utils/logger.js';
|
|
@@ -36,9 +36,9 @@ async function* prompt(analysisPrompt) {
|
|
|
36
36
|
/**
|
|
37
37
|
* Fetch feedbacks for branch planning phase
|
|
38
38
|
*/
|
|
39
|
-
async function fetchBranchPlanningFeedbacks(
|
|
39
|
+
async function fetchBranchPlanningFeedbacks(issueId, verbose) {
|
|
40
40
|
try {
|
|
41
|
-
const feedbacksContext = await getFeedbacksForPhase({
|
|
41
|
+
const feedbacksContext = await getFeedbacksForPhase({ issueId, verbose }, 'branch-planning');
|
|
42
42
|
if (verbose) {
|
|
43
43
|
logInfo(`📋 Feedbacks fetched: ${feedbacksContext.feedbacks.length} feedbacks found`);
|
|
44
44
|
}
|
|
@@ -72,7 +72,7 @@ function logPlanningMode(opts) {
|
|
|
72
72
|
* Build user prompt based on mode (incremental vs new planning)
|
|
73
73
|
*/
|
|
74
74
|
async function buildUserPrompt(opts) {
|
|
75
|
-
const { isIncrementalUpdate, feedbacksContext, existingBranchesInfo, contextInfo,
|
|
75
|
+
const { isIncrementalUpdate, feedbacksContext, existingBranchesInfo, contextInfo, issueId, verbose, } = opts;
|
|
76
76
|
if (isIncrementalUpdate && feedbacksContext) {
|
|
77
77
|
if (verbose) {
|
|
78
78
|
logInfo('\n🎯 Feedbacks that will be addressed:');
|
|
@@ -84,14 +84,14 @@ async function buildUserPrompt(opts) {
|
|
|
84
84
|
const feedbacksInfo = await formatFeedbacksForContext(feedbacksContext);
|
|
85
85
|
const currentPlanInfo = existingBranchesInfo || 'No existing branch plan documented.';
|
|
86
86
|
const systemPrompt = createImprovementPrompt(feedbacksInfo, currentPlanInfo);
|
|
87
|
-
return `${systemPrompt}\n\n##
|
|
87
|
+
return `${systemPrompt}\n\n## Issue Context\n\n${contextInfo}`;
|
|
88
88
|
}
|
|
89
|
-
return createBranchPlanningPromptWithContext(
|
|
89
|
+
return createBranchPlanningPromptWithContext(issueId, contextInfo, existingBranchesInfo || '');
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
92
|
* Create branches in database with proper dependencies
|
|
93
93
|
*/
|
|
94
|
-
async function persistBranches(sortedBranches,
|
|
94
|
+
async function persistBranches(sortedBranches, issueId, verbose) {
|
|
95
95
|
const branchNameToId = new Map();
|
|
96
96
|
for (const branch of sortedBranches) {
|
|
97
97
|
let baseBranchId;
|
|
@@ -108,7 +108,7 @@ async function persistBranches(sortedBranches, featureId, verbose) {
|
|
|
108
108
|
base_branch_id: baseBranchId,
|
|
109
109
|
status: 'pending',
|
|
110
110
|
};
|
|
111
|
-
const [created] = await createBranches({
|
|
111
|
+
const [created] = await createBranches({ issueId, verbose: false }, [
|
|
112
112
|
branchInput,
|
|
113
113
|
]);
|
|
114
114
|
if (created && branch.branch_name) {
|
|
@@ -117,15 +117,15 @@ async function persistBranches(sortedBranches, featureId, verbose) {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
// eslint-disable-next-line complexity
|
|
120
|
-
export const
|
|
121
|
-
const {
|
|
120
|
+
export const planIssueBranches = async (options, config) => {
|
|
121
|
+
const { issueId, verbose, replaceExisting } = options;
|
|
122
122
|
if (verbose) {
|
|
123
|
-
logInfo(`Starting branch planning for
|
|
123
|
+
logInfo(`Starting branch planning for issue ID: ${issueId}`);
|
|
124
124
|
}
|
|
125
125
|
try {
|
|
126
126
|
// Log phase start
|
|
127
|
-
await
|
|
128
|
-
|
|
127
|
+
await logIssuePhaseEvent({
|
|
128
|
+
issueId,
|
|
129
129
|
eventType: 'phase_started',
|
|
130
130
|
phase: 'branch_planning',
|
|
131
131
|
result: 'info',
|
|
@@ -135,9 +135,9 @@ export const planFeatureBranches = async (options, config) => {
|
|
|
135
135
|
},
|
|
136
136
|
}, verbose);
|
|
137
137
|
// Fetch context
|
|
138
|
-
const context = await fetchBranchPlanningContext(
|
|
138
|
+
const context = await fetchBranchPlanningContext(issueId, verbose);
|
|
139
139
|
// Fetch feedbacks for branch_planning phase
|
|
140
|
-
const feedbacksContext = await fetchBranchPlanningFeedbacks(
|
|
140
|
+
const feedbacksContext = await fetchBranchPlanningFeedbacks(issueId, verbose);
|
|
141
141
|
const hasFeedbacks = (feedbacksContext?.feedbacks.length || 0) > 0;
|
|
142
142
|
// Determine operation mode
|
|
143
143
|
const hasExistingBranches = context.existing_branches.length > 0;
|
|
@@ -154,28 +154,28 @@ export const planFeatureBranches = async (options, config) => {
|
|
|
154
154
|
// Check if there are existing branches and no feedbacks - no change needed
|
|
155
155
|
if (hasExistingBranches && !hasFeedbacks && !replaceExisting) {
|
|
156
156
|
if (verbose) {
|
|
157
|
-
logInfo(`
|
|
157
|
+
logInfo(`Issue already has ${context.existing_branches.length} branches planned and no feedbacks to address.`);
|
|
158
158
|
logInfo('Use replaceExisting: true to re-plan.');
|
|
159
159
|
}
|
|
160
|
-
return buildNoChangeResult(
|
|
160
|
+
return buildNoChangeResult(issueId, context.existing_branches.length);
|
|
161
161
|
}
|
|
162
162
|
// Clear existing branches if requested (full re-plan)
|
|
163
163
|
if (replaceExisting && hasExistingBranches) {
|
|
164
164
|
if (verbose) {
|
|
165
165
|
logInfo(`Clearing ${context.existing_branches.length} existing branches for full re-plan...`);
|
|
166
166
|
}
|
|
167
|
-
await clearBranches({
|
|
167
|
+
await clearBranches({ issueId, verbose }, true);
|
|
168
168
|
}
|
|
169
169
|
// Build the user prompt based on mode
|
|
170
|
-
const contextInfo = formatContextForPrompt(context.
|
|
170
|
+
const contextInfo = formatContextForPrompt(context.issue, context.product, context.user_stories, context.test_cases);
|
|
171
171
|
const existingBranchesInfo = formatExistingBranchesForPrompt(context.existing_branches);
|
|
172
|
-
const systemPrompt = await createBranchPlanningSystemPrompt(config,
|
|
172
|
+
const systemPrompt = await createBranchPlanningSystemPrompt(config, issueId);
|
|
173
173
|
const userPrompt = await buildUserPrompt({
|
|
174
174
|
isIncrementalUpdate,
|
|
175
175
|
feedbacksContext,
|
|
176
176
|
existingBranchesInfo,
|
|
177
177
|
contextInfo,
|
|
178
|
-
|
|
178
|
+
issueId,
|
|
179
179
|
verbose,
|
|
180
180
|
});
|
|
181
181
|
if (verbose) {
|
|
@@ -186,14 +186,14 @@ export const planFeatureBranches = async (options, config) => {
|
|
|
186
186
|
if (!result || !result.branches || result.branches.length === 0) {
|
|
187
187
|
const errorMsg = 'No branches were generated';
|
|
188
188
|
logError(errorMsg);
|
|
189
|
-
return buildErrorResult(
|
|
189
|
+
return buildErrorResult(issueId, errorMsg);
|
|
190
190
|
}
|
|
191
191
|
// Validate branches
|
|
192
192
|
const validation = validatePlannedBranches(result.branches);
|
|
193
193
|
if (!validation.valid) {
|
|
194
194
|
const errorMsg = `Invalid branch plan: ${validation.errors.join(', ')}`;
|
|
195
195
|
logError(errorMsg);
|
|
196
|
-
return buildErrorResult(
|
|
196
|
+
return buildErrorResult(issueId, errorMsg);
|
|
197
197
|
}
|
|
198
198
|
// Sort branches by dependency
|
|
199
199
|
const sortedBranches = sortBranchesByDependency(result.branches);
|
|
@@ -202,13 +202,13 @@ export const planFeatureBranches = async (options, config) => {
|
|
|
202
202
|
if (verbose) {
|
|
203
203
|
logInfo(`🔄 Clearing ${context.existing_branches.length} existing branches for incremental update...`);
|
|
204
204
|
}
|
|
205
|
-
await clearBranches({
|
|
205
|
+
await clearBranches({ issueId, verbose: false }, true);
|
|
206
206
|
}
|
|
207
207
|
// Create branches in database with proper dependencies
|
|
208
|
-
await persistBranches(sortedBranches,
|
|
208
|
+
await persistBranches(sortedBranches, issueId, verbose);
|
|
209
209
|
if (verbose) {
|
|
210
210
|
const modeLabel = isIncrementalUpdate ? '🔄 Updated' : '✅ Created';
|
|
211
|
-
logInfo(`${modeLabel} ${sortedBranches.length}
|
|
211
|
+
logInfo(`${modeLabel} ${sortedBranches.length} issue branches`);
|
|
212
212
|
sortedBranches.forEach((b, idx) => {
|
|
213
213
|
logInfo(` ${idx + 1}. ${b.name}`);
|
|
214
214
|
if (b.scope) {
|
|
@@ -217,8 +217,8 @@ export const planFeatureBranches = async (options, config) => {
|
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
// Log phase completion
|
|
220
|
-
await
|
|
221
|
-
|
|
220
|
+
await logIssuePhaseEvent({
|
|
221
|
+
issueId,
|
|
222
222
|
eventType: 'phase_completed',
|
|
223
223
|
phase: 'branch_planning',
|
|
224
224
|
result: 'success',
|
|
@@ -233,15 +233,15 @@ export const planFeatureBranches = async (options, config) => {
|
|
|
233
233
|
const summaryPrefix = isIncrementalUpdate
|
|
234
234
|
? `Updated branch plan based on ${feedbacksContext?.feedbacks.length || 0} feedbacks.`
|
|
235
235
|
: '';
|
|
236
|
-
return buildSuccessResult(
|
|
236
|
+
return buildSuccessResult(issueId, sortedBranches, result.summary ||
|
|
237
237
|
`${summaryPrefix} ${sortedBranches.length} branches for incremental development`.trim(), result.rationale);
|
|
238
238
|
}
|
|
239
239
|
catch (error) {
|
|
240
240
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
241
241
|
logError(`Branch planning failed: ${errorMessage}`);
|
|
242
242
|
// Log phase failure
|
|
243
|
-
await
|
|
244
|
-
|
|
243
|
+
await logIssuePhaseEvent({
|
|
244
|
+
issueId,
|
|
245
245
|
eventType: 'phase_failed',
|
|
246
246
|
phase: 'branch_planning',
|
|
247
247
|
result: 'error',
|
|
@@ -250,7 +250,7 @@ export const planFeatureBranches = async (options, config) => {
|
|
|
250
250
|
timestamp: new Date().toISOString(),
|
|
251
251
|
},
|
|
252
252
|
}, verbose);
|
|
253
|
-
return buildErrorResult(
|
|
253
|
+
return buildErrorResult(issueId, errorMessage);
|
|
254
254
|
}
|
|
255
255
|
};
|
|
256
256
|
/**
|
|
@@ -2,19 +2,19 @@ import { type BranchPlanningResult, type PlannedBranch } from './index.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Build a successful branch planning result
|
|
4
4
|
*/
|
|
5
|
-
export declare function buildSuccessResult(
|
|
5
|
+
export declare function buildSuccessResult(issueId: string, branches: PlannedBranch[], summary: string, rationale?: string): BranchPlanningResult;
|
|
6
6
|
/**
|
|
7
7
|
* Build an error result
|
|
8
8
|
*/
|
|
9
|
-
export declare function buildErrorResult(
|
|
9
|
+
export declare function buildErrorResult(issueId: string, errorMessage: string): BranchPlanningResult;
|
|
10
10
|
/**
|
|
11
11
|
* Build a result when no changes are needed
|
|
12
12
|
*/
|
|
13
|
-
export declare function buildNoChangeResult(
|
|
13
|
+
export declare function buildNoChangeResult(issueId: string, existingBranchCount: number): BranchPlanningResult;
|
|
14
14
|
/**
|
|
15
|
-
* Build a result for a single-branch
|
|
15
|
+
* Build a result for a single-branch issue
|
|
16
16
|
*/
|
|
17
|
-
export declare function buildSingleBranchResult(
|
|
17
|
+
export declare function buildSingleBranchResult(issueId: string, branch: PlannedBranch): BranchPlanningResult;
|
|
18
18
|
/**
|
|
19
19
|
* Validate planned branches
|
|
20
20
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Build a successful branch planning result
|
|
3
3
|
*/
|
|
4
|
-
export function buildSuccessResult(
|
|
4
|
+
export function buildSuccessResult(issueId, branches, summary, rationale) {
|
|
5
5
|
return {
|
|
6
|
-
|
|
6
|
+
issueId,
|
|
7
7
|
branches,
|
|
8
8
|
status: 'success',
|
|
9
9
|
summary,
|
|
@@ -13,9 +13,9 @@ export function buildSuccessResult(featureId, branches, summary, rationale) {
|
|
|
13
13
|
/**
|
|
14
14
|
* Build an error result
|
|
15
15
|
*/
|
|
16
|
-
export function buildErrorResult(
|
|
16
|
+
export function buildErrorResult(issueId, errorMessage) {
|
|
17
17
|
return {
|
|
18
|
-
|
|
18
|
+
issueId,
|
|
19
19
|
branches: [],
|
|
20
20
|
status: 'error',
|
|
21
21
|
summary: `Branch planning failed: ${errorMessage}`,
|
|
@@ -24,24 +24,24 @@ export function buildErrorResult(featureId, errorMessage) {
|
|
|
24
24
|
/**
|
|
25
25
|
* Build a result when no changes are needed
|
|
26
26
|
*/
|
|
27
|
-
export function buildNoChangeResult(
|
|
27
|
+
export function buildNoChangeResult(issueId, existingBranchCount) {
|
|
28
28
|
return {
|
|
29
|
-
|
|
29
|
+
issueId,
|
|
30
30
|
branches: [],
|
|
31
31
|
status: 'success',
|
|
32
|
-
summary: `
|
|
32
|
+
summary: `Issue already has ${existingBranchCount} branches planned. No changes needed.`,
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* Build a result for a single-branch
|
|
36
|
+
* Build a result for a single-branch issue
|
|
37
37
|
*/
|
|
38
|
-
export function buildSingleBranchResult(
|
|
38
|
+
export function buildSingleBranchResult(issueId, branch) {
|
|
39
39
|
return {
|
|
40
|
-
|
|
40
|
+
issueId,
|
|
41
41
|
branches: [branch],
|
|
42
42
|
status: 'success',
|
|
43
|
-
summary: '
|
|
44
|
-
rationale: 'The
|
|
43
|
+
summary: 'Issue is small enough to be implemented in a single branch.',
|
|
44
|
+
rationale: 'The issue scope is limited and can be completed in a single pull request without exceeding reasonable review size.',
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
@@ -2,15 +2,15 @@ import { type EdsgerConfig } from '../../types/index.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Create the system prompt for branch planning
|
|
4
4
|
*/
|
|
5
|
-
export declare function createBranchPlanningSystemPrompt(config: EdsgerConfig,
|
|
5
|
+
export declare function createBranchPlanningSystemPrompt(config: EdsgerConfig, issueId: string, projectDir?: string): Promise<string>;
|
|
6
6
|
/**
|
|
7
7
|
* Create the user prompt with context for branch planning
|
|
8
8
|
*/
|
|
9
|
-
export declare function createBranchPlanningPromptWithContext(
|
|
9
|
+
export declare function createBranchPlanningPromptWithContext(issueId: string, contextInfo: string, existingBranchesInfo: string): string;
|
|
10
10
|
/**
|
|
11
11
|
* Format the context information for the prompt
|
|
12
12
|
*/
|
|
13
|
-
export declare function formatContextForPrompt(
|
|
13
|
+
export declare function formatContextForPrompt(issue: {
|
|
14
14
|
name: string;
|
|
15
15
|
description?: string | null;
|
|
16
16
|
technical_design?: string | null;
|