fraim-framework 2.0.56 → 2.0.58
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/CHANGELOG.md +10 -0
- package/bin/fraim-mcp.js +14 -0
- package/bin/fraim.js +23 -0
- package/dist/src/cli/commands/init-project.js +10 -4
- package/dist/src/cli/commands/mcp.js +65 -0
- package/dist/src/cli/setup/mcp-config-generator.js +19 -16
- package/dist/src/fraim/issue-tracking/ado-provider.js +304 -0
- package/dist/src/fraim/issue-tracking/factory.js +63 -0
- package/dist/src/fraim/issue-tracking/github-provider.js +200 -0
- package/dist/src/fraim/issue-tracking/types.js +7 -0
- package/dist/src/fraim/issue-tracking-config.js +83 -0
- package/dist/src/local-mcp-server/stdio-server.js +207 -0
- package/dist/src/utils/workflow-parser.js +81 -0
- package/package.json +17 -12
- package/registry/scripts/pdf-styles.css +172 -0
- package/registry/scripts/prep-issue.sh +46 -4
- package/registry/scripts/profile-server.ts +131 -130
- package/registry/stubs/workflows/customer-development/user-survey-dispatch.md +1 -1
- package/registry/stubs/workflows/customer-development/users-to-target.md +1 -1
- package/registry/stubs/workflows/product-building/design.md +1 -1
- package/registry/stubs/workflows/product-building/implement.md +1 -1
- package/Claude.md +0 -1
- package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md +0 -101
- package/dist/registry/ai-manager-rules/customer-development-phases/phase2-platform-discovery.md +0 -235
- package/dist/registry/ai-manager-rules/customer-development-phases/phase3-prospect-qualification.md +0 -243
- package/dist/registry/ai-manager-rules/customer-development-phases/phase4-inventory-compilation.md +0 -206
- package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +0 -73
- package/dist/registry/ai-manager-rules/design-phases/design-design.md +0 -145
- package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +0 -283
- package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +0 -120
- package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +0 -173
- package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +0 -104
- package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +0 -100
- package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +0 -237
- package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +0 -121
- package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +0 -375
- package/dist/registry/ai-manager-rules/retrospective.md +0 -116
- package/dist/registry/ai-manager-rules/shared-phases/address-pr-feedback.md +0 -188
- package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +0 -202
- package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +0 -170
- package/dist/registry/ai-manager-rules/spec-phases/spec-competitor-analysis.md +0 -105
- package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +0 -66
- package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +0 -139
- package/dist/registry/ai-manager-rules/user-survey-phases/phase1-survey-scoping.md +0 -60
- package/dist/registry/ai-manager-rules/user-survey-phases/phase2-survey-build-linkedin.md +0 -23
- package/dist/registry/ai-manager-rules/user-survey-phases/phase3-survey-build-reddit.md +0 -22
- package/dist/registry/ai-manager-rules/user-survey-phases/phase4-survey-build-x.md +0 -21
- package/dist/registry/ai-manager-rules/user-survey-phases/phase5-survey-build-facebook.md +0 -19
- package/dist/registry/ai-manager-rules/user-survey-phases/phase6-survey-build-custom.md +0 -15
- package/dist/registry/ai-manager-rules/user-survey-phases/phase7-survey-dispatch.md +0 -45
- package/dist/registry/providers/ado.json +0 -19
- package/dist/registry/providers/github.json +0 -19
- package/dist/registry/scripts/cleanup-branch.js +0 -287
- package/dist/registry/scripts/evaluate-code-quality.js +0 -66
- package/dist/registry/scripts/exec-with-timeout.js +0 -142
- package/dist/registry/scripts/generate-engagement-emails.js +0 -705
- package/dist/registry/scripts/newsletter-helpers.js +0 -671
- package/dist/registry/scripts/profile-server.js +0 -388
- package/dist/registry/scripts/run-thank-you-workflow.js +0 -92
- package/dist/registry/scripts/send-newsletter-simple.js +0 -85
- package/dist/registry/scripts/send-thank-you-emails.js +0 -54
- package/dist/registry/scripts/validate-openapi-limits.js +0 -311
- package/dist/registry/scripts/validate-test-coverage.js +0 -262
- package/dist/registry/scripts/verify-test-coverage.js +0 -66
- package/dist/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +0 -53
- package/dist/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +0 -37
- package/dist/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +0 -35
- package/dist/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +0 -29
- package/dist/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +0 -126
- package/dist/registry/templates/customer-development/customer-interview-template.md +0 -99
- package/dist/registry/templates/customer-development/customer-persona-template.md +0 -69
- package/dist/registry/templates/customer-development/follow-up-email-templates.md +0 -132
- package/dist/registry/templates/customer-development/insight-analysis-template.md +0 -74
- package/dist/registry/templates/customer-development/prospect-inventory-template.csv +0 -3
- package/dist/registry/templates/customer-development/search-strategy-template.md +0 -123
- package/dist/registry/templates/customer-development/strategic-recommendations-template.md +0 -53
- package/dist/registry/templates/customer-development/thank-you-email-template.html +0 -124
- package/dist/registry/templates/customer-development/thank-you-note-template.md +0 -16
- package/dist/registry/templates/customer-development/triage-log-template.md +0 -278
- package/dist/registry/templates/customer-development/weekly-newsletter-template.html +0 -204
- package/dist/registry/templates/evidence/Design-Evidence.md +0 -30
- package/dist/registry/templates/evidence/Implementation-BugEvidence.md +0 -94
- package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +0 -129
- package/dist/registry/templates/evidence/Spec-Evidence.md +0 -19
- package/dist/registry/templates/help/HelpNeeded.md +0 -14
- package/dist/registry/templates/legal/NDA-TEMPLATE.md +0 -170
- package/dist/registry/templates/legal/PATENT-TEMPLATE.md +0 -372
- package/dist/registry/templates/legal/TRADEMARK-TEMPLATE.md +0 -339
- package/dist/registry/templates/legal/contract-review-checklist.md +0 -193
- package/dist/registry/templates/legal/review-report-template.md +0 -198
- package/dist/registry/templates/legal/saas-terms-template.md +0 -174
- package/dist/registry/templates/legal/sow-template.md +0 -117
- package/dist/registry/templates/legal/template-variables.md +0 -131
- package/dist/registry/templates/marketing/DOMAIN-REGISTRATION-TEMPLATE.md +0 -194
- package/dist/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +0 -66
- package/dist/registry/templates/marketing/STORYTELLING-TEMPLATE.md +0 -130
- package/dist/registry/templates/marketing/WEBSITE-TEMPLATE.md +0 -262
- package/dist/registry/templates/marketing/github-pages-workflow.yml +0 -64
- package/dist/registry/templates/replicate/implementation-checklist.md +0 -39
- package/dist/registry/templates/replicate/use-cases-template.md +0 -88
- package/dist/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +0 -55
- package/dist/registry/templates/specs/BUGSPEC-TEMPLATE.md +0 -37
- package/dist/registry/templates/specs/FEATURESPEC-TEMPLATE.md +0 -66
- package/dist/registry/templates/specs/TECHSPEC-TEMPLATE.md +0 -39
- package/dist/registry/workflows/bootstrap/create-architecture.md +0 -38
- package/dist/registry/workflows/bootstrap/detect-broken-windows.md +0 -300
- package/dist/registry/workflows/bootstrap/evaluate-code-quality.md +0 -35
- package/dist/registry/workflows/bootstrap/verify-test-coverage.md +0 -36
- package/dist/registry/workflows/brainstorming/blue-sky-brainstorming.md +0 -211
- package/dist/registry/workflows/brainstorming/codebase-brainstorming.md +0 -165
- package/dist/registry/workflows/business-development/create-business-plan.md +0 -737
- package/dist/registry/workflows/business-development/ideate-business-opportunity.md +0 -55
- package/dist/registry/workflows/business-development/price-product.md +0 -325
- package/dist/registry/workflows/compliance/detect-compliance-requirements.md +0 -78
- package/dist/registry/workflows/compliance/generate-audit-evidence.md +0 -75
- package/dist/registry/workflows/compliance/soc2-evidence-generator.md +0 -332
- package/dist/registry/workflows/customer-development/insight-analysis.md +0 -156
- package/dist/registry/workflows/customer-development/insight-triage.md +0 -938
- package/dist/registry/workflows/customer-development/interview-preparation.md +0 -452
- package/dist/registry/workflows/customer-development/linkedin-outreach.md +0 -593
- package/dist/registry/workflows/customer-development/strategic-brainstorming.md +0 -146
- package/dist/registry/workflows/customer-development/thank-customers.md +0 -203
- package/dist/registry/workflows/customer-development/user-survey-dispatch.md +0 -60
- package/dist/registry/workflows/customer-development/users-to-target.md +0 -112
- package/dist/registry/workflows/customer-development/weekly-newsletter.md +0 -366
- package/dist/registry/workflows/deploy/cloud-deployment.md +0 -310
- package/dist/registry/workflows/improve-fraim/contribute.md +0 -32
- package/dist/registry/workflows/improve-fraim/file-issue.md +0 -32
- package/dist/registry/workflows/learning/build-skillset.md +0 -212
- package/dist/registry/workflows/learning/synthesize-learnings.md +0 -284
- package/dist/registry/workflows/legal/contract-review-analysis.md +0 -382
- package/dist/registry/workflows/legal/nda.md +0 -69
- package/dist/registry/workflows/legal/patent-filing.md +0 -76
- package/dist/registry/workflows/legal/saas-contract-development.md +0 -213
- package/dist/registry/workflows/legal/trademark-filing.md +0 -77
- package/dist/registry/workflows/marketing/content-creation.md +0 -37
- package/dist/registry/workflows/marketing/convert-to-pdf.md +0 -235
- package/dist/registry/workflows/marketing/create-modern-website.md +0 -456
- package/dist/registry/workflows/marketing/domain-registration.md +0 -323
- package/dist/registry/workflows/marketing/hbr-article.md +0 -73
- package/dist/registry/workflows/marketing/launch-checklist.md +0 -37
- package/dist/registry/workflows/marketing/marketing-strategy.md +0 -45
- package/dist/registry/workflows/marketing/storytelling.md +0 -65
- package/dist/registry/workflows/performance/analyze-performance.md +0 -65
- package/dist/registry/workflows/product-building/design.md +0 -103
- package/dist/registry/workflows/product-building/implement.md +0 -74
- package/dist/registry/workflows/product-building/iterate-on-pr-comments.md +0 -70
- package/dist/registry/workflows/product-building/prep-issue.md +0 -41
- package/dist/registry/workflows/product-building/prototype.md +0 -65
- package/dist/registry/workflows/product-building/resolve.md +0 -168
- package/dist/registry/workflows/product-building/retrospect.md +0 -86
- package/dist/registry/workflows/product-building/spec.md +0 -181
- package/dist/registry/workflows/product-building/test.md +0 -125
- package/dist/registry/workflows/productivity-report/productivity-report.md +0 -263
- package/dist/registry/workflows/quality-assurance/browser-validation.md +0 -221
- package/dist/registry/workflows/quality-assurance/iterative-improvement-cycle.md +0 -562
- package/dist/registry/workflows/replicate/replicate-discovery.md +0 -336
- package/dist/registry/workflows/replicate/replicate-to-issues.md +0 -324
- package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +0 -638
- package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -675
- package/dist/registry/workflows/startup-credits/aws-activate-application.md +0 -535
- package/dist/registry/workflows/startup-credits/google-cloud-application.md +0 -647
- package/dist/registry/workflows/startup-credits/microsoft-azure-application.md +0 -538
- package/dist/scripts/build-stub-registry.js +0 -108
- package/dist/src/ai-manager/ai-manager.js +0 -480
- package/dist/src/ai-manager/phase-flow.js +0 -357
- package/dist/src/ai-manager/types.js +0 -5
- package/dist/src/fraim-mcp-server.js +0 -1885
- package/dist/tests/debug-tools.js +0 -80
- package/dist/tests/shared-server-utils.js +0 -57
- package/dist/tests/test-add-ide.js +0 -283
- package/dist/tests/test-ai-coach-edge-cases.js +0 -420
- package/dist/tests/test-ai-coach-mcp-integration.js +0 -450
- package/dist/tests/test-ai-coach-performance.js +0 -328
- package/dist/tests/test-ai-coach-phase-content.js +0 -264
- package/dist/tests/test-ai-coach-workflows.js +0 -514
- package/dist/tests/test-cli.js +0 -228
- package/dist/tests/test-client-scripts-validation.js +0 -167
- package/dist/tests/test-complete-setup-flow.js +0 -110
- package/dist/tests/test-config-system.js +0 -279
- package/dist/tests/test-debug-session.js +0 -134
- package/dist/tests/test-end-to-end-hybrid-validation.js +0 -328
- package/dist/tests/test-enhanced-session-init.js +0 -188
- package/dist/tests/test-first-run-journey.js +0 -368
- package/dist/tests/test-fraim-issues.js +0 -59
- package/dist/tests/test-genericization.js +0 -44
- package/dist/tests/test-hybrid-script-execution.js +0 -340
- package/dist/tests/test-ide-detector.js +0 -46
- package/dist/tests/test-improved-setup.js +0 -121
- package/dist/tests/test-mcp-config-generator.js +0 -99
- package/dist/tests/test-mcp-connection.js +0 -107
- package/dist/tests/test-mcp-issue-integration.js +0 -156
- package/dist/tests/test-mcp-lifecycle-methods.js +0 -240
- package/dist/tests/test-mcp-shared-server.js +0 -308
- package/dist/tests/test-mcp-template-processing.js +0 -160
- package/dist/tests/test-modular-issue-tracking.js +0 -165
- package/dist/tests/test-node-compatibility.js +0 -95
- package/dist/tests/test-npm-install.js +0 -68
- package/dist/tests/test-package-size.js +0 -108
- package/dist/tests/test-pr-review-workflow.js +0 -307
- package/dist/tests/test-prep-issue.js +0 -129
- package/dist/tests/test-productivity-integration.js +0 -157
- package/dist/tests/test-script-location-independence.js +0 -198
- package/dist/tests/test-script-sync.js +0 -557
- package/dist/tests/test-server-utils.js +0 -32
- package/dist/tests/test-session-rehydration.js +0 -148
- package/dist/tests/test-setup-integration.js +0 -98
- package/dist/tests/test-setup-scenarios.js +0 -322
- package/dist/tests/test-standalone.js +0 -143
- package/dist/tests/test-stub-registry.js +0 -136
- package/dist/tests/test-sync-stubs.js +0 -143
- package/dist/tests/test-sync-version-update.js +0 -93
- package/dist/tests/test-telemetry.js +0 -193
- package/dist/tests/test-token-validator.js +0 -30
- package/dist/tests/test-user-journey.js +0 -236
- package/dist/tests/test-users-to-target-workflow.js +0 -253
- package/dist/tests/test-utils.js +0 -109
- package/dist/tests/test-wizard.js +0 -71
- package/dist/tests/test-workflow-discovery.js +0 -242
- package/labels.json +0 -52
- package/registry/agent-guardrails.md +0 -63
- package/registry/fraim.md +0 -48
- package/setup.js +0 -171
- package/tsconfig.json +0 -23
|
@@ -1,514 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Comprehensive tests for AI Coach and stepwise workflows
|
|
4
|
-
* Tests the complete phase-based workflow system including:
|
|
5
|
-
* - Phase loading and validation
|
|
6
|
-
* - Phase transitions and flow logic
|
|
7
|
-
* - Workflow completion and error handling
|
|
8
|
-
* - File path resolution and content loading
|
|
9
|
-
*/
|
|
10
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
const node_test_1 = require("node:test");
|
|
15
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
16
|
-
const ai_manager_js_1 = require("../src/ai-manager/ai-manager.js");
|
|
17
|
-
const phase_flow_js_1 = require("../src/ai-manager/phase-flow.js");
|
|
18
|
-
const fs_1 = require("fs");
|
|
19
|
-
const path_1 = require("path");
|
|
20
|
-
(0, node_test_1.describe)('AI Coach and Stepwise Workflows', () => {
|
|
21
|
-
let coach;
|
|
22
|
-
let fileIndex;
|
|
23
|
-
(0, node_test_1.before)(() => {
|
|
24
|
-
// Create a comprehensive file index for testing
|
|
25
|
-
fileIndex = new Map();
|
|
26
|
-
// Add all phase files to the index
|
|
27
|
-
const phaseFiles = [
|
|
28
|
-
// Shared phases
|
|
29
|
-
'ai-manager-rules/shared-phases/wait-for-pr-review.md',
|
|
30
|
-
// Implement phases
|
|
31
|
-
'ai-manager-rules/implement-phases/implement-scoping.md',
|
|
32
|
-
'ai-manager-rules/implement-phases/implement-repro.md',
|
|
33
|
-
'ai-manager-rules/implement-phases/implement-spike.md',
|
|
34
|
-
'ai-manager-rules/implement-phases/implement-code.md',
|
|
35
|
-
'ai-manager-rules/implement-phases/implement-validate.md',
|
|
36
|
-
'ai-manager-rules/implement-phases/implement-smoke.md',
|
|
37
|
-
'ai-manager-rules/implement-phases/implement-regression.md',
|
|
38
|
-
'ai-manager-rules/implement-phases/implement-completeness-review.md',
|
|
39
|
-
// Spec phases
|
|
40
|
-
'ai-manager-rules/spec-phases/spec-spec.md',
|
|
41
|
-
'ai-manager-rules/spec-phases/spec-completeness-review.md',
|
|
42
|
-
// Design phases
|
|
43
|
-
'ai-manager-rules/design-phases/design-design.md',
|
|
44
|
-
'ai-manager-rules/design-phases/design-completeness-review.md'
|
|
45
|
-
];
|
|
46
|
-
phaseFiles.forEach(path => {
|
|
47
|
-
const fullPath = (0, path_1.join)(process.cwd(), 'registry', path);
|
|
48
|
-
if ((0, fs_1.existsSync)(fullPath)) {
|
|
49
|
-
fileIndex.set(path, { fullPath });
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
coach = new ai_manager_js_1.AICoach(fileIndex);
|
|
53
|
-
});
|
|
54
|
-
(0, node_test_1.describe)('Phase Flow Logic', () => {
|
|
55
|
-
(0, node_test_1.it)('should return correct next phase for implement bug workflow', () => {
|
|
56
|
-
const phases = ['implement-scoping', 'implement-repro', 'implement-code', 'implement-validate', 'implement-regression', 'implement-completeness-review', 'submit-pr', 'wait-for-pr-review', 'retrospective'];
|
|
57
|
-
for (let i = 0; i < phases.length - 1; i++) {
|
|
58
|
-
const nextPhase = (0, phase_flow_js_1.getNextPhase)(phases[i], 'implement', 'bug');
|
|
59
|
-
node_assert_1.default.strictEqual(nextPhase, phases[i + 1], `Next phase after ${phases[i]} should be ${phases[i + 1]}`);
|
|
60
|
-
}
|
|
61
|
-
// Last phase should return null
|
|
62
|
-
const lastPhase = (0, phase_flow_js_1.getNextPhase)('retrospective', 'implement', 'bug');
|
|
63
|
-
node_assert_1.default.strictEqual(lastPhase, null, 'retrospective phase should return null as next phase');
|
|
64
|
-
});
|
|
65
|
-
(0, node_test_1.it)('should return correct next phase for implement feature workflow', () => {
|
|
66
|
-
const phases = ['implement-scoping', 'implement-spike', 'implement-code', 'implement-validate', 'implement-smoke', 'implement-regression', 'implement-completeness-review', 'submit-pr', 'wait-for-pr-review', 'retrospective'];
|
|
67
|
-
for (let i = 0; i < phases.length - 1; i++) {
|
|
68
|
-
const nextPhase = (0, phase_flow_js_1.getNextPhase)(phases[i], 'implement', 'feature');
|
|
69
|
-
node_assert_1.default.strictEqual(nextPhase, phases[i + 1], `Next phase after ${phases[i]} should be ${phases[i + 1]}`);
|
|
70
|
-
}
|
|
71
|
-
// Last phase should return null
|
|
72
|
-
const lastPhase = (0, phase_flow_js_1.getNextPhase)('retrospective', 'implement', 'feature');
|
|
73
|
-
node_assert_1.default.strictEqual(lastPhase, null, 'retrospective phase should return null as next phase');
|
|
74
|
-
});
|
|
75
|
-
(0, node_test_1.it)('should return correct next phase for spec workflow', () => {
|
|
76
|
-
const phases = ['spec-spec', 'spec-competitor-analysis', 'spec-completeness-review', 'submit-pr', 'wait-for-pr-review', 'retrospective'];
|
|
77
|
-
for (let i = 0; i < phases.length - 1; i++) {
|
|
78
|
-
const nextPhase = (0, phase_flow_js_1.getNextPhase)(phases[i], 'spec');
|
|
79
|
-
node_assert_1.default.strictEqual(nextPhase, phases[i + 1], `Next phase after ${phases[i]} should be ${phases[i + 1]}`);
|
|
80
|
-
}
|
|
81
|
-
// Last phase should return null
|
|
82
|
-
const lastPhase = (0, phase_flow_js_1.getNextPhase)('retrospective', 'spec');
|
|
83
|
-
node_assert_1.default.strictEqual(lastPhase, null, 'retrospective phase should return null as next phase');
|
|
84
|
-
});
|
|
85
|
-
(0, node_test_1.it)('should return correct next phase for design workflow', () => {
|
|
86
|
-
const phases = ['design-design', 'design-completeness-review', 'submit-pr', 'wait-for-pr-review', 'retrospective'];
|
|
87
|
-
for (let i = 0; i < phases.length - 1; i++) {
|
|
88
|
-
const nextPhase = (0, phase_flow_js_1.getNextPhase)(phases[i], 'design');
|
|
89
|
-
node_assert_1.default.strictEqual(nextPhase, phases[i + 1], `Next phase after ${phases[i]} should be ${phases[i + 1]}`);
|
|
90
|
-
}
|
|
91
|
-
// Last phase should return null
|
|
92
|
-
const lastPhase = (0, phase_flow_js_1.getNextPhase)('retrospective', 'design');
|
|
93
|
-
node_assert_1.default.strictEqual(lastPhase, null, 'retrospective phase should return null as next phase');
|
|
94
|
-
});
|
|
95
|
-
(0, node_test_1.it)('should validate phases correctly for each workflow type', () => {
|
|
96
|
-
// Test implement workflow phases
|
|
97
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('implement-scoping', 'implement', 'bug'), true);
|
|
98
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('implement-repro', 'implement', 'bug'), true);
|
|
99
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('implement-spike', 'implement', 'feature'), true);
|
|
100
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('spec-spec', 'implement', 'bug'), false);
|
|
101
|
-
// Test spec workflow phases
|
|
102
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('spec-spec', 'spec'), true);
|
|
103
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('spec-completeness-review', 'spec'), true);
|
|
104
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('implement-scoping', 'spec'), false);
|
|
105
|
-
// Test design workflow phases
|
|
106
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('design-design', 'design'), true);
|
|
107
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('design-completeness-review', 'design'), true);
|
|
108
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('spec-spec', 'design'), false);
|
|
109
|
-
// Test finalize phase (no longer valid - replaced with submit-pr and wait-for-pr-review)
|
|
110
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('submit-pr', 'implement', 'bug'), true);
|
|
111
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('wait-for-pr-review', 'implement', 'bug'), true);
|
|
112
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('submit-pr', 'spec'), true);
|
|
113
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('wait-for-pr-review', 'spec'), true);
|
|
114
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('submit-pr', 'design'), true);
|
|
115
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('wait-for-pr-review', 'design'), true);
|
|
116
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('finalize', 'implement', 'bug'), false);
|
|
117
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('finalize', 'spec'), false);
|
|
118
|
-
node_assert_1.default.strictEqual((0, phase_flow_js_1.isPhaseValidForWorkflow)('finalize', 'design'), false);
|
|
119
|
-
});
|
|
120
|
-
(0, node_test_1.it)('should return correct phases for each workflow type', () => {
|
|
121
|
-
const bugPhases = (0, phase_flow_js_1.getPhasesForWorkflow)('implement', 'bug');
|
|
122
|
-
const expectedBugPhases = ['implement-scoping', 'implement-repro', 'implement-code', 'implement-validate', 'implement-regression', 'implement-completeness-review', 'submit-pr', 'wait-for-pr-review', 'retrospective'];
|
|
123
|
-
node_assert_1.default.deepStrictEqual(bugPhases, expectedBugPhases);
|
|
124
|
-
const featurePhases = (0, phase_flow_js_1.getPhasesForWorkflow)('implement', 'feature');
|
|
125
|
-
const expectedFeaturePhases = ['implement-scoping', 'implement-spike', 'implement-code', 'implement-validate', 'implement-smoke', 'implement-regression', 'implement-completeness-review', 'submit-pr', 'wait-for-pr-review', 'retrospective'];
|
|
126
|
-
node_assert_1.default.deepStrictEqual(featurePhases, expectedFeaturePhases);
|
|
127
|
-
const specPhases = (0, phase_flow_js_1.getPhasesForWorkflow)('spec');
|
|
128
|
-
const expectedSpecPhases = ['spec-spec', 'spec-competitor-analysis', 'spec-completeness-review', 'submit-pr', 'wait-for-pr-review', 'retrospective'];
|
|
129
|
-
node_assert_1.default.deepStrictEqual(specPhases, expectedSpecPhases);
|
|
130
|
-
const designPhases = (0, phase_flow_js_1.getPhasesForWorkflow)('design');
|
|
131
|
-
const expectedDesignPhases = ['design-design', 'design-completeness-review', 'submit-pr', 'wait-for-pr-review', 'retrospective'];
|
|
132
|
-
node_assert_1.default.deepStrictEqual(designPhases, expectedDesignPhases);
|
|
133
|
-
});
|
|
134
|
-
(0, node_test_1.it)('should throw error for invalid workflow types', () => {
|
|
135
|
-
node_assert_1.default.throws(() => {
|
|
136
|
-
(0, phase_flow_js_1.getNextPhase)('implement-scoping', 'invalid');
|
|
137
|
-
}, /Unknown workflow type/);
|
|
138
|
-
node_assert_1.default.throws(() => {
|
|
139
|
-
(0, phase_flow_js_1.getPhasesForWorkflow)('invalid');
|
|
140
|
-
}, /Unknown workflow type/);
|
|
141
|
-
});
|
|
142
|
-
(0, node_test_1.it)('should throw error for invalid phases', () => {
|
|
143
|
-
node_assert_1.default.throws(() => {
|
|
144
|
-
(0, phase_flow_js_1.getNextPhase)('invalid-phase', 'implement', 'bug');
|
|
145
|
-
}, /Invalid phase/);
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
(0, node_test_1.describe)('AI Coach Phase Loading', () => {
|
|
149
|
-
(0, node_test_1.it)('should load implement phase instructions correctly', async () => {
|
|
150
|
-
const phases = ['implement-scoping', 'implement-repro', 'implement-code', 'implement-validate'];
|
|
151
|
-
for (const phase of phases) {
|
|
152
|
-
const result = await coach.handleCoachingRequest({
|
|
153
|
-
workflowType: 'implement',
|
|
154
|
-
currentPhase: phase,
|
|
155
|
-
status: 'starting',
|
|
156
|
-
issueNumber: '123',
|
|
157
|
-
evidence: { issueType: 'bug' }
|
|
158
|
-
});
|
|
159
|
-
node_assert_1.default.ok(result.includes('Phase:'), `Phase instructions should contain 'Phase:' for ${phase}`);
|
|
160
|
-
node_assert_1.default.ok(result.includes('INTENT'), `Phase instructions should contain 'INTENT' for ${phase}`);
|
|
161
|
-
node_assert_1.default.ok(result.includes('OUTCOME'), `Phase instructions should contain 'OUTCOME' for ${phase}`);
|
|
162
|
-
node_assert_1.default.ok(!result.includes('**Error**'), `Phase instructions should not contain errors for ${phase}`);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
(0, node_test_1.it)('should load spec phase instructions correctly', async () => {
|
|
166
|
-
const phases = ['spec-spec', 'spec-completeness-review'];
|
|
167
|
-
for (const phase of phases) {
|
|
168
|
-
const result = await coach.handleCoachingRequest({
|
|
169
|
-
workflowType: 'spec',
|
|
170
|
-
currentPhase: phase,
|
|
171
|
-
status: 'starting',
|
|
172
|
-
issueNumber: '123',
|
|
173
|
-
evidence: { issueType: 'feature' }
|
|
174
|
-
});
|
|
175
|
-
node_assert_1.default.ok(result.includes('Phase:'), `Phase instructions should contain 'Phase:' for ${phase}`);
|
|
176
|
-
node_assert_1.default.ok(result.includes('INTENT'), `Phase instructions should contain 'INTENT' for ${phase}`);
|
|
177
|
-
node_assert_1.default.ok(result.includes('OUTCOME'), `Phase instructions should contain 'OUTCOME' for ${phase}`);
|
|
178
|
-
node_assert_1.default.ok(!result.includes('**Error**'), `Phase instructions should not contain errors for ${phase}`);
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
(0, node_test_1.it)('should load design phase instructions correctly', async () => {
|
|
182
|
-
const phases = ['design-design', 'design-completeness-review'];
|
|
183
|
-
for (const phase of phases) {
|
|
184
|
-
const result = await coach.handleCoachingRequest({
|
|
185
|
-
workflowType: 'design',
|
|
186
|
-
currentPhase: phase,
|
|
187
|
-
status: 'starting',
|
|
188
|
-
issueNumber: '123',
|
|
189
|
-
evidence: { issueType: 'feature' }
|
|
190
|
-
});
|
|
191
|
-
node_assert_1.default.ok(result.includes('Phase:'), `Phase instructions should contain 'Phase:' for ${phase}`);
|
|
192
|
-
node_assert_1.default.ok(result.includes('INTENT'), `Phase instructions should contain 'INTENT' for ${phase}`);
|
|
193
|
-
node_assert_1.default.ok(result.includes('OUTCOME'), `Phase instructions should contain 'OUTCOME' for ${phase}`);
|
|
194
|
-
node_assert_1.default.ok(!result.includes('**Error**'), `Phase instructions should not contain errors for ${phase}`);
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
(0, node_test_1.it)('should load shared wait-for-pr-review phase for all workflows', async () => {
|
|
198
|
-
const workflows = ['implement', 'spec', 'design'];
|
|
199
|
-
for (const workflow of workflows) {
|
|
200
|
-
const result = await coach.handleCoachingRequest({
|
|
201
|
-
workflowType: workflow,
|
|
202
|
-
currentPhase: 'wait-for-pr-review',
|
|
203
|
-
status: 'starting',
|
|
204
|
-
issueNumber: '123',
|
|
205
|
-
evidence: { issueType: 'feature' }
|
|
206
|
-
});
|
|
207
|
-
node_assert_1.default.ok(result.includes('Phase:'), `wait-for-pr-review phase should load for ${workflow} workflow`);
|
|
208
|
-
node_assert_1.default.ok(result.includes('INTENT'), `wait-for-pr-review phase should contain INTENT for ${workflow} workflow`);
|
|
209
|
-
node_assert_1.default.ok(result.includes('OUTCOME'), `wait-for-pr-review phase should contain OUTCOME for ${workflow} workflow`);
|
|
210
|
-
node_assert_1.default.ok(!result.includes('**Error**'), `wait-for-pr-review phase should not contain errors for ${workflow} workflow`);
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
(0, node_test_1.describe)('Phase Transitions', () => {
|
|
215
|
-
(0, node_test_1.it)('should provide next phase instructions when phase is complete', async () => {
|
|
216
|
-
// Test spec workflow transition
|
|
217
|
-
const result = await coach.handleCoachingRequest({
|
|
218
|
-
workflowType: 'spec',
|
|
219
|
-
currentPhase: 'spec-spec',
|
|
220
|
-
status: 'complete',
|
|
221
|
-
issueNumber: '123',
|
|
222
|
-
evidence: { issueType: 'feature', specComplete: true }
|
|
223
|
-
});
|
|
224
|
-
node_assert_1.default.ok(result.includes('Phase Complete!'), 'Should indicate phase completion');
|
|
225
|
-
node_assert_1.default.ok(result.includes('Next Phase: spec-competitor-analysis'), 'Should provide next phase instructions');
|
|
226
|
-
node_assert_1.default.ok(result.includes('Phase: spec-competitor-analysis'), 'Should include next phase content');
|
|
227
|
-
});
|
|
228
|
-
(0, node_test_1.it)('should provide completion message for wait-for-pr-review phase', async () => {
|
|
229
|
-
const result = await coach.handleCoachingRequest({
|
|
230
|
-
workflowType: 'spec',
|
|
231
|
-
currentPhase: 'retrospective',
|
|
232
|
-
status: 'complete',
|
|
233
|
-
issueNumber: '123',
|
|
234
|
-
evidence: { issueType: 'feature', retrospectiveComplete: true }
|
|
235
|
-
});
|
|
236
|
-
node_assert_1.default.ok(result.includes('Spec Complete!'), 'Should show workflow completion message');
|
|
237
|
-
node_assert_1.default.ok(result.includes('Congratulations!'), 'Should include congratulations');
|
|
238
|
-
node_assert_1.default.ok(result.includes('What You\'ve Accomplished'), 'Should list accomplishments');
|
|
239
|
-
});
|
|
240
|
-
(0, node_test_1.it)('should handle incomplete phase status with help message', async () => {
|
|
241
|
-
const result = await coach.handleCoachingRequest({
|
|
242
|
-
workflowType: 'implement',
|
|
243
|
-
currentPhase: 'implement-code',
|
|
244
|
-
status: 'incomplete',
|
|
245
|
-
issueNumber: '123',
|
|
246
|
-
evidence: { issueType: 'bug' },
|
|
247
|
-
findings: { uncertainties: ['Tests are failing', 'Build errors'] }
|
|
248
|
-
});
|
|
249
|
-
node_assert_1.default.ok(result.includes('🤝 AI Coach Assistance'), 'Should show assistance header');
|
|
250
|
-
node_assert_1.default.ok(result.includes('Incomplete - Need Help'), 'Should indicate incomplete status');
|
|
251
|
-
node_assert_1.default.ok(result.includes('Tests are failing'), 'Should list specific uncertainties');
|
|
252
|
-
node_assert_1.default.ok(result.includes('Build errors'), 'Should list all uncertainties');
|
|
253
|
-
node_assert_1.default.ok(result.includes('Complete Phase Guidance'), 'Should provide complete guidance');
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
(0, node_test_1.describe)('Error Handling', () => {
|
|
257
|
-
(0, node_test_1.it)('should reject invalid workflow types', async () => {
|
|
258
|
-
try {
|
|
259
|
-
await coach.handleCoachingRequest({
|
|
260
|
-
workflowType: 'invalid',
|
|
261
|
-
currentPhase: 'some-phase',
|
|
262
|
-
status: 'starting',
|
|
263
|
-
issueNumber: '123'
|
|
264
|
-
});
|
|
265
|
-
node_assert_1.default.fail('Should have thrown error for invalid workflow type');
|
|
266
|
-
}
|
|
267
|
-
catch (error) {
|
|
268
|
-
node_assert_1.default.ok(error instanceof Error);
|
|
269
|
-
node_assert_1.default.ok(error.message.includes('Invalid workflow type'));
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
(0, node_test_1.it)('should reject invalid phases for workflow types', async () => {
|
|
273
|
-
try {
|
|
274
|
-
await coach.handleCoachingRequest({
|
|
275
|
-
workflowType: 'spec',
|
|
276
|
-
currentPhase: 'implement-scoping',
|
|
277
|
-
status: 'starting',
|
|
278
|
-
issueNumber: '123',
|
|
279
|
-
evidence: { issueType: 'feature' }
|
|
280
|
-
});
|
|
281
|
-
node_assert_1.default.fail('Should have thrown error for invalid phase');
|
|
282
|
-
}
|
|
283
|
-
catch (error) {
|
|
284
|
-
node_assert_1.default.ok(error instanceof Error);
|
|
285
|
-
node_assert_1.default.ok(error.message.includes('Invalid phase'));
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
(0, node_test_1.it)('should provide helpful error when using wrong phase for issue type', async () => {
|
|
289
|
-
try {
|
|
290
|
-
await coach.handleCoachingRequest({
|
|
291
|
-
workflowType: 'implement',
|
|
292
|
-
currentPhase: 'implement-repro', // Bug phase
|
|
293
|
-
status: 'complete',
|
|
294
|
-
issueNumber: '123',
|
|
295
|
-
findings: {
|
|
296
|
-
issueType: 'feature' // But specified as feature
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
node_assert_1.default.fail('Should have thrown error for wrong phase');
|
|
300
|
-
}
|
|
301
|
-
catch (error) {
|
|
302
|
-
node_assert_1.default.ok(error instanceof Error);
|
|
303
|
-
node_assert_1.default.ok(error.message.includes('Invalid Phase for Issue Type'), `Error message should mention invalid phase for issue type. Got: ${error.message}`);
|
|
304
|
-
node_assert_1.default.ok(error.message.includes('implement-repro'), `Error message should mention the invalid phase. Got: ${error.message}`);
|
|
305
|
-
node_assert_1.default.ok(error.message.includes('feature'), `Error message should mention the issue type. Got: ${error.message}`);
|
|
306
|
-
node_assert_1.default.ok(error.message.includes('implement-spike'), `Error message should show valid phases for features. Got: ${error.message}`);
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
(0, node_test_1.it)('should provide helpful error when issueType is missing for implement workflow', async () => {
|
|
310
|
-
try {
|
|
311
|
-
await coach.handleCoachingRequest({
|
|
312
|
-
workflowType: 'implement',
|
|
313
|
-
currentPhase: 'implement-repro', // This phase is only valid for bugs
|
|
314
|
-
status: 'complete',
|
|
315
|
-
issueNumber: '123'
|
|
316
|
-
// Missing issueType in evidence/findings - will default to 'feature'
|
|
317
|
-
});
|
|
318
|
-
node_assert_1.default.fail('Should have thrown error for missing issue type');
|
|
319
|
-
}
|
|
320
|
-
catch (error) {
|
|
321
|
-
node_assert_1.default.ok(error instanceof Error);
|
|
322
|
-
node_assert_1.default.ok(error.message.includes('Missing Required Field: issueType'), `Error message should mention missing issueType. Got: ${error.message}`);
|
|
323
|
-
node_assert_1.default.ok(error.message.includes('findings: {'), `Error message should show correct format. Got: ${error.message}`);
|
|
324
|
-
node_assert_1.default.ok(error.message.includes('issueType: "bug"'), `Error message should show example. Got: ${error.message}`);
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
});
|
|
328
|
-
(0, node_test_1.describe)('Workflow Accomplishments', () => {
|
|
329
|
-
(0, node_test_1.it)('should show correct accomplishments for each workflow type', async () => {
|
|
330
|
-
const workflows = [
|
|
331
|
-
{ type: 'spec', expectedText: '**Specification**: Created comprehensive feature specification' },
|
|
332
|
-
{ type: 'design', expectedText: '**Design**: Created technical design and architecture' },
|
|
333
|
-
{ type: 'implement', expectedText: '**Scoping**: Understood requirements and issue type' }
|
|
334
|
-
];
|
|
335
|
-
for (const workflow of workflows) {
|
|
336
|
-
const result = await coach.handleCoachingRequest({
|
|
337
|
-
workflowType: workflow.type,
|
|
338
|
-
currentPhase: 'retrospective',
|
|
339
|
-
status: 'complete',
|
|
340
|
-
issueNumber: '123',
|
|
341
|
-
evidence: { issueType: 'feature', retrospectiveComplete: true }
|
|
342
|
-
});
|
|
343
|
-
node_assert_1.default.ok(result.includes(workflow.expectedText), `${workflow.type} workflow should show correct accomplishments`);
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
});
|
|
347
|
-
(0, node_test_1.describe)('File Path Resolution', () => {
|
|
348
|
-
(0, node_test_1.it)('should resolve phase file paths correctly', () => {
|
|
349
|
-
// Test that all expected phase files exist
|
|
350
|
-
const expectedFiles = [
|
|
351
|
-
'registry/ai-manager-rules/shared-phases/wait-for-pr-review.md',
|
|
352
|
-
'registry/ai-manager-rules/implement-phases/implement-scoping.md',
|
|
353
|
-
'registry/ai-manager-rules/implement-phases/implement-code.md',
|
|
354
|
-
'registry/ai-manager-rules/spec-phases/spec-spec.md',
|
|
355
|
-
'registry/ai-manager-rules/spec-phases/spec-completeness-review.md',
|
|
356
|
-
'registry/ai-manager-rules/design-phases/design-design.md',
|
|
357
|
-
'registry/ai-manager-rules/design-phases/design-completeness-review.md'
|
|
358
|
-
];
|
|
359
|
-
for (const filePath of expectedFiles) {
|
|
360
|
-
const fullPath = (0, path_1.join)(process.cwd(), filePath);
|
|
361
|
-
node_assert_1.default.ok((0, fs_1.existsSync)(fullPath), `Phase file should exist: ${filePath}`);
|
|
362
|
-
// Verify file has content
|
|
363
|
-
const content = (0, fs_1.readFileSync)(fullPath, 'utf8');
|
|
364
|
-
node_assert_1.default.ok(content.length > 0, `Phase file should have content: ${filePath}`);
|
|
365
|
-
node_assert_1.default.ok(content.includes('# Phase:'), `Phase file should have proper header: ${filePath}`);
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
(0, node_test_1.it)('should have consistent phase file naming', () => {
|
|
369
|
-
const implementPhases = [
|
|
370
|
-
'implement-scoping', 'implement-repro', 'implement-spike', 'implement-code',
|
|
371
|
-
'implement-validate', 'implement-smoke', 'implement-regression', 'implement-completeness-review'
|
|
372
|
-
];
|
|
373
|
-
for (const phase of implementPhases) {
|
|
374
|
-
const filePath = (0, path_1.join)(process.cwd(), 'registry/ai-manager-rules/implement-phases', `${phase}.md`);
|
|
375
|
-
node_assert_1.default.ok((0, fs_1.existsSync)(filePath), `Implement phase file should exist: ${phase}.md`);
|
|
376
|
-
}
|
|
377
|
-
const specPhases = ['spec-spec', 'spec-completeness-review'];
|
|
378
|
-
for (const phase of specPhases) {
|
|
379
|
-
const filePath = (0, path_1.join)(process.cwd(), 'registry/ai-manager-rules/spec-phases', `${phase}.md`);
|
|
380
|
-
node_assert_1.default.ok((0, fs_1.existsSync)(filePath), `Spec phase file should exist: ${phase}.md`);
|
|
381
|
-
}
|
|
382
|
-
const designPhases = ['design-design', 'design-completeness-review'];
|
|
383
|
-
for (const phase of designPhases) {
|
|
384
|
-
const filePath = (0, path_1.join)(process.cwd(), 'registry/ai-manager-rules/design-phases', `${phase}.md`);
|
|
385
|
-
node_assert_1.default.ok((0, fs_1.existsSync)(filePath), `Design phase file should exist: ${phase}.md`);
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
});
|
|
389
|
-
(0, node_test_1.describe)('Integration Tests', () => {
|
|
390
|
-
(0, node_test_1.it)('should complete full spec workflow', async () => {
|
|
391
|
-
const issueNumber = '123';
|
|
392
|
-
const workflowType = 'spec';
|
|
393
|
-
// Start with spec phase
|
|
394
|
-
let result = await coach.handleCoachingRequest({
|
|
395
|
-
workflowType,
|
|
396
|
-
currentPhase: 'spec-spec',
|
|
397
|
-
status: 'starting',
|
|
398
|
-
issueNumber,
|
|
399
|
-
evidence: { issueType: 'feature' }
|
|
400
|
-
});
|
|
401
|
-
node_assert_1.default.ok(result.includes('Phase: Spec-Spec'), 'Should start with spec phase');
|
|
402
|
-
// Complete spec phase
|
|
403
|
-
result = await coach.handleCoachingRequest({
|
|
404
|
-
workflowType,
|
|
405
|
-
currentPhase: 'spec-spec',
|
|
406
|
-
status: 'complete',
|
|
407
|
-
issueNumber,
|
|
408
|
-
evidence: { issueType: 'feature', specComplete: true }
|
|
409
|
-
});
|
|
410
|
-
node_assert_1.default.ok(result.includes('Next Phase: spec-competitor-analysis'), 'Should transition to competitor analysis');
|
|
411
|
-
// Complete competitor analysis
|
|
412
|
-
result = await coach.handleCoachingRequest({
|
|
413
|
-
workflowType,
|
|
414
|
-
currentPhase: 'spec-competitor-analysis',
|
|
415
|
-
status: 'complete',
|
|
416
|
-
issueNumber,
|
|
417
|
-
evidence: { issueType: 'feature', competitorAnalysisComplete: true }
|
|
418
|
-
});
|
|
419
|
-
node_assert_1.default.ok(result.includes('Next Phase: spec-completeness-review'), 'Should transition to completeness review');
|
|
420
|
-
// Complete completeness review
|
|
421
|
-
result = await coach.handleCoachingRequest({
|
|
422
|
-
workflowType,
|
|
423
|
-
currentPhase: 'spec-completeness-review',
|
|
424
|
-
status: 'complete',
|
|
425
|
-
issueNumber,
|
|
426
|
-
evidence: { issueType: 'feature', reviewComplete: true }
|
|
427
|
-
});
|
|
428
|
-
node_assert_1.default.ok(result.includes('Next Phase: submit-pr'), 'Should transition to submit-pr');
|
|
429
|
-
// Complete submit-pr
|
|
430
|
-
result = await coach.handleCoachingRequest({
|
|
431
|
-
workflowType,
|
|
432
|
-
currentPhase: 'submit-pr',
|
|
433
|
-
status: 'complete',
|
|
434
|
-
issueNumber,
|
|
435
|
-
evidence: { issueType: 'feature', prSubmitted: true }
|
|
436
|
-
});
|
|
437
|
-
node_assert_1.default.ok(result.includes('Next Phase: wait-for-pr-review'), 'Should transition to wait-for-pr-review');
|
|
438
|
-
// Complete wait-for-pr-review
|
|
439
|
-
result = await coach.handleCoachingRequest({
|
|
440
|
-
workflowType,
|
|
441
|
-
currentPhase: 'wait-for-pr-review',
|
|
442
|
-
status: 'complete',
|
|
443
|
-
issueNumber,
|
|
444
|
-
evidence: { issueType: 'feature', prApproved: true }
|
|
445
|
-
});
|
|
446
|
-
node_assert_1.default.ok(result.includes('Next Phase: retrospective'), 'Should transition to retrospective');
|
|
447
|
-
// Complete retrospective
|
|
448
|
-
result = await coach.handleCoachingRequest({
|
|
449
|
-
workflowType,
|
|
450
|
-
currentPhase: 'retrospective',
|
|
451
|
-
status: 'complete',
|
|
452
|
-
issueNumber,
|
|
453
|
-
evidence: { issueType: 'feature', retrospectiveComplete: true }
|
|
454
|
-
});
|
|
455
|
-
node_assert_1.default.ok(result.includes('Spec Complete!'), 'Should show completion message');
|
|
456
|
-
});
|
|
457
|
-
(0, node_test_1.it)('should complete full implement bug workflow', async () => {
|
|
458
|
-
const issueNumber = '456';
|
|
459
|
-
const workflowType = 'implement';
|
|
460
|
-
const issueType = 'bug';
|
|
461
|
-
// Test key phases in bug workflow including retrospective
|
|
462
|
-
const phases = ['implement-scoping', 'implement-repro', 'implement-code', 'wait-for-pr-review', 'retrospective'];
|
|
463
|
-
for (let i = 0; i < phases.length; i++) {
|
|
464
|
-
const phase = phases[i];
|
|
465
|
-
const isLast = i === phases.length - 1;
|
|
466
|
-
const result = await coach.handleCoachingRequest({
|
|
467
|
-
workflowType,
|
|
468
|
-
currentPhase: phase,
|
|
469
|
-
status: 'complete',
|
|
470
|
-
issueNumber,
|
|
471
|
-
evidence: { issueType },
|
|
472
|
-
findings: { issueType }
|
|
473
|
-
});
|
|
474
|
-
if (isLast) {
|
|
475
|
-
node_assert_1.default.ok(result.includes('Implement Complete!'), 'Should show completion for final phase');
|
|
476
|
-
}
|
|
477
|
-
else {
|
|
478
|
-
node_assert_1.default.ok(result.includes('Next Phase:'), `Should show next phase after ${phase}`);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
(0, node_test_1.it)('should handle workflow with help requests', async () => {
|
|
483
|
-
// Start phase
|
|
484
|
-
let result = await coach.handleCoachingRequest({
|
|
485
|
-
workflowType: 'design',
|
|
486
|
-
currentPhase: 'design-design',
|
|
487
|
-
status: 'starting',
|
|
488
|
-
issueNumber: '789',
|
|
489
|
-
evidence: { issueType: 'feature' }
|
|
490
|
-
});
|
|
491
|
-
node_assert_1.default.ok(result.includes('Phase: Design-Design'), 'Should provide initial instructions');
|
|
492
|
-
// Request help
|
|
493
|
-
result = await coach.handleCoachingRequest({
|
|
494
|
-
workflowType: 'design',
|
|
495
|
-
currentPhase: 'design-design',
|
|
496
|
-
status: 'incomplete',
|
|
497
|
-
issueNumber: '789',
|
|
498
|
-
evidence: { issueType: 'feature' },
|
|
499
|
-
findings: { uncertainties: ['Not sure about database schema', 'API design unclear'] }
|
|
500
|
-
});
|
|
501
|
-
node_assert_1.default.ok(result.includes('🤝 AI Coach Assistance'), 'Should provide help');
|
|
502
|
-
node_assert_1.default.ok(result.includes('Not sure about database schema'), 'Should include specific uncertainties');
|
|
503
|
-
// Complete after help
|
|
504
|
-
result = await coach.handleCoachingRequest({
|
|
505
|
-
workflowType: 'design',
|
|
506
|
-
currentPhase: 'design-design',
|
|
507
|
-
status: 'complete',
|
|
508
|
-
issueNumber: '789',
|
|
509
|
-
evidence: { issueType: 'feature', designComplete: true }
|
|
510
|
-
});
|
|
511
|
-
node_assert_1.default.ok(result.includes('Next Phase: design-completeness-review'), 'Should proceed to next phase');
|
|
512
|
-
});
|
|
513
|
-
});
|
|
514
|
-
});
|