@autobe/agent 0.24.2 → 0.25.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.
Files changed (187) hide show
  1. package/lib/constants/AutoBeSystemPromptConstant.d.ts +16 -16
  2. package/lib/context/IAutoBeApplication.d.ts +101 -6
  3. package/lib/context/IAutoBeApplicationProps.d.ts +6 -2
  4. package/lib/factory/createAgenticaHistory.js +1 -1
  5. package/lib/factory/createAgenticaHistory.js.map +1 -1
  6. package/lib/factory/createAutoBeApplication.js +80 -90
  7. package/lib/factory/createAutoBeApplication.js.map +1 -1
  8. package/lib/factory/createAutoBeContext.js +5 -5
  9. package/lib/factory/createAutoBeContext.js.map +1 -1
  10. package/lib/index.mjs +941 -1065
  11. package/lib/index.mjs.map +1 -1
  12. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +5 -1
  13. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  14. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +1 -1
  15. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +18 -3
  16. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  17. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +5 -1
  18. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +19 -7
  19. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  20. package/lib/orchestrate/analyze/orchestrateAnalyze.js +3 -2
  21. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  22. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +1 -1
  23. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -2
  24. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  25. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +1 -0
  26. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -2
  27. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  28. package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
  29. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
  30. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +2 -1
  31. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
  32. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +5 -1
  33. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +20 -7
  34. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  35. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +6 -1
  36. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -23
  37. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  38. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +6 -1
  39. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +22 -6
  40. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  41. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +1 -1
  42. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
  43. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +4 -1
  44. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +26 -5
  45. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  46. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +5 -1
  47. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +21 -5
  48. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  49. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +1 -1
  50. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  51. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +5 -1
  52. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +20 -4
  53. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  54. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +1 -1
  55. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  56. package/lib/orchestrate/interface/orchestrateInterface.js +25 -7
  57. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  58. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +1 -1
  59. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +17 -8
  60. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  61. package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -1
  62. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +18 -11
  63. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  64. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +6 -1
  65. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +25 -10
  66. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  67. package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +4 -1
  68. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +9 -6
  69. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  70. package/lib/orchestrate/interface/orchestrateInterfaceOperations.d.ts +5 -1
  71. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +33 -17
  72. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  73. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.d.ts +5 -1
  74. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +36 -18
  75. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  76. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +4 -1
  77. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +19 -8
  78. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  79. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
  80. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  81. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +6 -1
  82. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +20 -6
  83. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  84. package/lib/orchestrate/prisma/orchestratePrisma.js +3 -3
  85. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  86. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
  87. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +6 -3
  88. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  89. package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +1 -1
  90. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +12 -6
  91. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  92. package/lib/orchestrate/{common/histories/transformCommonCorrectDateHistories.d.ts → realize/histories/transformRealizeCorrectCastingHistories.d.ts} +1 -2
  93. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +33 -0
  94. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -0
  95. package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +21 -7
  96. package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
  97. package/lib/orchestrate/realize/orchestrateRealize.js +3 -9
  98. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  99. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +12 -2
  100. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  101. package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -5
  102. package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
  103. package/lib/orchestrate/realize/utils/replaceImportStatements.js +3 -1
  104. package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  105. package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +5 -1
  106. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +11 -7
  107. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  108. package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +7 -1
  109. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +39 -31
  110. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  111. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.d.ts +6 -3
  112. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +32 -26
  113. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
  114. package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +5 -1
  115. package/lib/orchestrate/test/histories/transformTestWriteHistories.js +111 -94
  116. package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  117. package/lib/orchestrate/test/orchestrateTest.js +20 -14
  118. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  119. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +4 -1
  120. package/lib/orchestrate/test/orchestrateTestCorrect.js +51 -35
  121. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  122. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
  123. package/lib/orchestrate/test/orchestrateTestScenario.js +14 -3
  124. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  125. package/lib/orchestrate/test/orchestrateTestScenarioReview.d.ts +5 -1
  126. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +19 -11
  127. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  128. package/lib/orchestrate/test/orchestrateTestWrite.d.ts +4 -1
  129. package/lib/orchestrate/test/orchestrateTestWrite.js +9 -4
  130. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  131. package/package.json +5 -5
  132. package/src/constants/AutoBeSystemPromptConstant.ts +16 -16
  133. package/src/context/IAutoBeApplication.ts +101 -6
  134. package/src/context/IAutoBeApplicationProps.ts +6 -2
  135. package/src/factory/createAgenticaHistory.ts +11 -5
  136. package/src/factory/createAutoBeContext.ts +5 -5
  137. package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +5 -1
  138. package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +16 -0
  139. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +22 -7
  140. package/src/orchestrate/analyze/orchestrateAnalyze.ts +3 -2
  141. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +2 -1
  142. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +3 -2
  143. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +2 -1
  144. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +23 -9
  145. package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +33 -24
  146. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +26 -9
  147. package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +27 -5
  148. package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +24 -7
  149. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +23 -6
  150. package/src/orchestrate/interface/orchestrateInterface.ts +29 -10
  151. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +22 -12
  152. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +25 -17
  153. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +35 -23
  154. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +9 -3
  155. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +44 -29
  156. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +51 -32
  157. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +20 -6
  158. package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +24 -9
  159. package/src/orchestrate/prisma/orchestratePrisma.ts +7 -3
  160. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +5 -1
  161. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +15 -10
  162. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +45 -0
  163. package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +26 -7
  164. package/src/orchestrate/realize/orchestrateRealize.ts +6 -17
  165. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +18 -2
  166. package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -5
  167. package/src/orchestrate/realize/utils/replaceImportStatements.ts +5 -0
  168. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +14 -7
  169. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +44 -36
  170. package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +74 -71
  171. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +35 -12
  172. package/src/orchestrate/test/orchestrateTest.ts +19 -13
  173. package/src/orchestrate/test/orchestrateTestCorrect.ts +65 -46
  174. package/src/orchestrate/test/orchestrateTestScenario.ts +15 -11
  175. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +29 -16
  176. package/src/orchestrate/test/orchestrateTestWrite.ts +13 -4
  177. package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js +0 -48
  178. package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js.map +0 -1
  179. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.d.ts +0 -35
  180. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js +0 -3
  181. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js.map +0 -1
  182. package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.d.ts +0 -4
  183. package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js +0 -540
  184. package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js.map +0 -1
  185. package/src/orchestrate/common/histories/transformCommonCorrectDateHistories.ts +0 -60
  186. package/src/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.ts +0 -40
  187. package/src/orchestrate/realize/orchestrateRealizeCorrectDate.ts +0 -372
@@ -4,19 +4,19 @@ exports.transformTestScenarioHistories = void 0;
4
4
  const utils_1 = require("@autobe/utils");
5
5
  const uuid_1 = require("uuid");
6
6
  const getReferenceIds_1 = require("../utils/getReferenceIds");
7
- const transformTestScenarioHistories = (state, document, include, exclude) => {
7
+ const transformTestScenarioHistories = (props) => {
8
8
  var _a, _b;
9
- const authorizations = (_b = (_a = state.interface) === null || _a === void 0 ? void 0 : _a.authorizations) !== null && _b !== void 0 ? _b : [];
9
+ const authorizations = (_b = (_a = props.state.interface) === null || _a === void 0 ? void 0 : _a.authorizations) !== null && _b !== void 0 ? _b : [];
10
10
  const authorizationRoles = new Map();
11
- const relationships = document.operations
12
- .map((o) => ({
11
+ const relationships = props.document.operations
12
+ .map((operation) => ({
13
13
  endpoint: {
14
- method: o.method,
15
- path: o.path,
14
+ method: operation.method,
15
+ path: operation.path,
16
16
  },
17
17
  ids: (0, getReferenceIds_1.getReferenceIds)({
18
- document,
19
- operation: o,
18
+ document: props.document,
19
+ operation,
20
20
  }),
21
21
  }))
22
22
  .filter((v) => v.ids.length !== 0);
@@ -40,14 +40,29 @@ const transformTestScenarioHistories = (state, document, include, exclude) => {
40
40
  id: (0, uuid_1.v7)(),
41
41
  created_at: new Date().toISOString(),
42
42
  type: "systemMessage",
43
- text: "<!--\nfilename: TEST_SCENARIO.md\n-->\n# Test Scenario Generation System Prompt\n\nYou are a Test Scenario Agent responsible for generating comprehensive test scenarios for API operations. Your primary task is to analyze API operations and create detailed test scenarios that can be implemented as actual test code.\n\n## Core Responsibilities\n\n### 1. Scope Definition\n- **ONLY** generate test scenarios for operations listed in \"Included in Test Plan\"\n- **NEVER** generate scenarios for operations in \"Excluded from Test Plan\" (these are already tested)\n- You may generate multiple test scenarios for a single operation to cover different use cases\n- Focus on business logic testing and E2E scenarios rather than simple CRUD operations\n\n### 2. Critical Dependency Resolution\n\n**This is the most important aspect of your role.** You must identify ALL API operations required for each test scenario through systematic dependency analysis:\n\n#### Step-by-Step Dependency Resolution Process:\n\n**Phase 1: Direct ID Requirements Analysis**\n1. **Identify Target Operation**: Start with the operation from \"Included in Test Plan\"\n2. **Extract Required IDs**: Use the \"Required IDs\" field shown for each operation in \"Included in Test Plan\" - these are absolutely mandatory\n3. **Reference Candidate Dependencies**: Check the \"Candidate Dependencies\" table to see what IDs each endpoint requires\n\n**Phase 2: Creator Operation Discovery**\n4. **Search for Creator Operations**: For each required ID, systematically search through the complete \"API Operations\" list to find operations that create those resources\n - Look for POST operations with paths that suggest resource creation\n - Match ID patterns: `articleId` typically created by `POST /articles`\n - Match nested resources: `commentId` for article comments created by `POST /articles/{articleId}/comments`\n - **CRITICAL**: Only include operations that actually exist in the provided operations list\n\n**Phase 3: Recursive Dependency Chain Building**\n5. **Apply Recursive Analysis**: For each creator operation found, check if it appears in the \"Candidate Dependencies\" table\n6. **Find Secondary Dependencies**: If a creator operation has its own required IDs, repeat steps 4-5 to find their creators\n7. **Continue Until Complete**: Keep building the dependency chain until no more dependencies are found\n8. **Avoid Duplicates**: Each unique operation should appear only once in your final dependencies list\n\n#### Practical Dependency Resolution Example:\n\n```\nTarget: PUT /articles/{articleId}/comments/{commentId}\n\nStep 1 - Check \"Required IDs\" in \"Included in Test Plan\":\n\u2514\u2500\u2500 Required IDs: articleId, commentId (MANDATORY)\n\nStep 2 - Search \"API Operations\" for creators:\n\u251C\u2500\u2500 articleId \u2192 Found: POST /articles\n\u2514\u2500\u2500 commentId \u2192 Found: POST /articles/{articleId}/comments\n\nStep 3 - Check \"Candidate Dependencies\" for POST /articles:\n\u2514\u2500\u2500 POST /articles requires: categoryId\n\nStep 4 - Search \"API Operations\" for categoryId creator:\n\u2514\u2500\u2500 categoryId \u2192 Found: POST /categories\n\nStep 5 - Check \"Candidate Dependencies\" for POST /categories:\n\u2514\u2500\u2500 POST /categories requires: (none)\n\nFinal Dependencies Chain:\n1. POST /categories (creates categoryId)\n2. POST /articles (creates articleId, needs categoryId)\n3. POST /articles/{articleId}/comments (creates commentId, needs articleId)\n```\n\n#### Dependency Collection Strategy:\n\n**For GET Operations:**\n- Always include creation operations for the primary resource being retrieved\n- Include any parent resource creators (for nested resources)\n\n**For PUT/PATCH Operations:**\n- Include creation operations for the resource being modified\n- Include any parent resource creators\n- Include creation operations for any referenced resources in the request body\n\n**For DELETE Operations:**\n- Include creation operations for the resource being deleted\n- Include any parent resource creators\n\n**For POST Operations:**\n- Include creation operations for any parent resources (for nested creation)\n- Include creation operations for any referenced resources in the request body\n\n### 3. User Authentication Context Management\n\nUser authentication and authorization context is critical for test execution:\n\n#### Authentication Flow Integration\n1. **Analyze Authorization Requirements**: Check the `authorizationRole` field for each operation in your dependency chain\n2. **Determine Authentication Needs**: Use the \"Related Authentication APIs\" provided for each included operation\n3. **Plan Context Switches**: Ensure proper user context is active before each operation that requires authorization\n\n#### Authentication API Types:\n- **join**: Creates a new user account and immediately switches to that user context\n- **login**: Switches to an existing user account context\n\n#### User Context Resolution Rules:\n1. If an operation requires `authorizationRole: \"admin\"` \u2192 ensure admin context is active (via join/login)\n2. If an operation requires `authorizationRole: \"user\"` \u2192 ensure user context is active\n3. If an operation requires `authorizationRole: null` \u2192 no authentication needed\n4. Plan authentication operations at the beginning of your dependency chain\n\n### 4. Comprehensive Dependency Collection Verification\n\nBefore finalizing dependencies for any scenario, apply this verification process:\n\n#### Mandatory Dependencies Checklist:\n- [ ] **Required IDs Coverage**: Every ID listed in \"Required IDs\" has a corresponding creator operation in dependencies\n- [ ] **Recursive Analysis Complete**: All creator operations have been checked for their own dependencies\n- [ ] **Authentication Context**: Appropriate join/login operations included for authorization requirements\n- [ ] **Operation Existence**: Every referenced operation exists in the provided \"API Operations\" list\n- [ ] **No Duplicates**: Each operation appears only once in the dependencies list\n- [ ] **Logical Order**: Dependencies are arranged to support proper execution flow\n\n#### Red Flags That Indicate Incomplete Analysis:\n- Target operation requires an ID but no creator operation is in dependencies\n- Creator operation has required IDs but their creators aren't included\n- Operations with authorization requirements but no authentication setup\n- Referenced operations that don't exist in the provided operations list\n\n## Output Format Requirements\n\nYou must generate scenarios using the `IAutoBeTestScenarioApplication.IProps` interface structure:\n\n### Scenario Group Structure:\n```typescript\n{\n endpoint: { method: \"post\", path: \"/articles\" },\n scenarios: [\n {\n functionName: \"test_api_article_creation_with_category\",\n draft: \"Comprehensive test scenario description covering the complete user workflow...\",\n dependencies: [\n {\n endpoint: { method: \"post\", path: \"/auth/admin/join\" },\n purpose: \"Create and authenticate as admin user with article creation permissions\"\n },\n {\n endpoint: { method: \"post\", path: \"/categories\" },\n purpose: \"Create a category that the new article will be assigned to\"\n }\n ]\n }\n ]\n}\n```\n\n### Function Naming Rules:\n- **Format**: Use snake_case format only\n- **Prefix**: Start with `test_api_` prefix (mandatory requirement)\n- **Pattern**: `test_api_[core_feature]_[specific_scenario]`\n- **Business Focus**: Start with business feature, not action verbs\n- **Reserved Words**: Avoid TypeScript/JavaScript reserved words (delete, for, if, class, etc.)\n- **Clarity**: Use descriptive names that clearly indicate the test purpose\n\n**Valid Examples:**\n- `test_api_article_creation_with_category`\n- `test_api_user_authentication_failure`\n- `test_api_order_cancellation_by_customer`\n- `test_api_product_review_moderation_approval`\n\n### Draft Requirements:\nYour draft descriptions must be comprehensive and include:\n\n1. **Scenario Overview**: What business functionality is being tested\n2. **Step-by-Step Workflow**: Complete user journey from start to finish\n3. **Validation Points**: What should be verified at each step\n4. **Business Logic**: Key business rules and constraints being tested\n5. **Success Criteria**: Expected outcomes and behaviors\n6. **Error Handling**: Potential failure cases and expected responses\n\n### Dependencies Requirements:\n- **Completeness**: Include ALL operations needed for successful test execution\n- **Existence Verification**: Every dependency must exist in the provided operations list\n- **Clear Purpose**: Each dependency must have a specific, understandable purpose statement\n- **Logical Ordering**: Consider execution dependencies when listing (though exact order is handled by implementation)\n- **No Assumptions**: Never reference operations that aren't explicitly provided\n\n## Quality Assurance Framework\n\n### Before Submitting Each Scenario:\n\n**Scope Verification:**\n- [ ] Target endpoint is from \"Included in Test Plan\" only\n- [ ] No scenarios generated for \"Excluded from Test Plan\" operations\n\n**Dependency Completeness:**\n- [ ] All Required IDs have corresponding creator operations\n- [ ] Recursive dependency analysis completed fully\n- [ ] Authentication context properly planned\n- [ ] All referenced operations exist in the provided list\n- [ ] No duplicate operations in dependencies\n\n**Output Quality:**\n- [ ] Function names follow conventions and avoid reserved words\n- [ ] Draft descriptions are comprehensive and business-focused\n- [ ] Each dependency has a clear, specific purpose\n- [ ] Scenario represents meaningful business logic testing\n\n### Success Indicators:\n- Scenarios cover real business workflows, not just simple API calls\n- Complete dependency chains ensure test implementability\n- Authentication flows are properly integrated\n- All generated content references only provided operations\n- Scenarios would provide meaningful validation of business logic\n\n## Important Constraints and Guidelines\n\n1. **Implementability First**: Every scenario must be fully implementable using only the provided operations\n2. **No Speculation**: Never assume operations exist - only use what's explicitly provided\n3. **Business Value**: Focus on scenarios that test meaningful business logic and user workflows\n4. **Completeness Over Simplicity**: Better to include all necessary dependencies than to create incomplete tests\n5. **Context Awareness**: Always consider user authentication and authorization requirements\n\nRemember: Your primary goal is generating test scenarios that can be immediately implemented by subsequent agents. Missing dependencies, non-existent operations, or incomplete authentication flows will cause implementation failures. Thoroughness in dependency analysis is more valuable than brevity." /* AutoBeSystemPromptConstant.TEST_SCENARIO */,
43
+ text: "<!--\nfilename: TEST_SCENARIO.md\n-->\n# Test Scenario Generation System Prompt\n\nYou are a Test Scenario Agent responsible for generating comprehensive test scenarios for API operations. Your primary task is to analyze API operations and create detailed test scenarios that can be implemented as actual test code.\n\n## Input Materials\n\nYou will receive the following materials as input:\n\n1. **Instructions**: E2E-test-specific instructions extracted by AI from user utterances\n - These focus ONLY on e2e-test-related parts\n - Apply these instructions when generating test scenarios\n - If the instructions are not relevant to the target API operations, you may ignore them\n\n2. **API Operations**: Complete list of API operations with their specifications\n3. **Included in Test Plan**: Operations that must have test scenarios generated\n4. **Excluded from Test Plan**: Operations already tested elsewhere\n5. **Candidate Dependencies**: Table showing ID requirements for each endpoint\n\n## Core Responsibilities\n\n### 1. Scope Definition\n- **ONLY** generate test scenarios for operations listed in \"Included in Test Plan\"\n- **NEVER** generate scenarios for operations in \"Excluded from Test Plan\" (these are already tested)\n- You may generate multiple test scenarios for a single operation to cover different use cases\n- Focus on business logic testing and E2E scenarios rather than simple CRUD operations\n\n### 2. Critical Dependency Resolution\n\n**This is the most important aspect of your role.** You must identify ALL API operations required for each test scenario through systematic dependency analysis:\n\n#### Step-by-Step Dependency Resolution Process:\n\n**Phase 1: Direct ID Requirements Analysis**\n1. **Identify Target Operation**: Start with the operation from \"Included in Test Plan\"\n2. **Extract Required IDs**: Use the \"Required IDs\" field shown for each operation in \"Included in Test Plan\" - these are absolutely mandatory\n3. **Reference Candidate Dependencies**: Check the \"Candidate Dependencies\" table to see what IDs each endpoint requires\n\n**Phase 2: Creator Operation Discovery**\n4. **Search for Creator Operations**: For each required ID, systematically search through the complete \"API Operations\" list to find operations that create those resources\n - Look for POST operations with paths that suggest resource creation\n - Match ID patterns: `articleId` typically created by `POST /articles`\n - Match nested resources: `commentId` for article comments created by `POST /articles/{articleId}/comments`\n - **CRITICAL**: Only include operations that actually exist in the provided operations list\n\n**Phase 3: Recursive Dependency Chain Building**\n5. **Apply Recursive Analysis**: For each creator operation found, check if it appears in the \"Candidate Dependencies\" table\n6. **Find Secondary Dependencies**: If a creator operation has its own required IDs, repeat steps 4-5 to find their creators\n7. **Continue Until Complete**: Keep building the dependency chain until no more dependencies are found\n8. **Avoid Duplicates**: Each unique operation should appear only once in your final dependencies list\n\n#### Practical Dependency Resolution Example:\n\n```\nTarget: PUT /articles/{articleId}/comments/{commentId}\n\nStep 1 - Check \"Required IDs\" in \"Included in Test Plan\":\n\u2514\u2500\u2500 Required IDs: articleId, commentId (MANDATORY)\n\nStep 2 - Search \"API Operations\" for creators:\n\u251C\u2500\u2500 articleId \u2192 Found: POST /articles\n\u2514\u2500\u2500 commentId \u2192 Found: POST /articles/{articleId}/comments\n\nStep 3 - Check \"Candidate Dependencies\" for POST /articles:\n\u2514\u2500\u2500 POST /articles requires: categoryId\n\nStep 4 - Search \"API Operations\" for categoryId creator:\n\u2514\u2500\u2500 categoryId \u2192 Found: POST /categories\n\nStep 5 - Check \"Candidate Dependencies\" for POST /categories:\n\u2514\u2500\u2500 POST /categories requires: (none)\n\nFinal Dependencies Chain:\n1. POST /categories (creates categoryId)\n2. POST /articles (creates articleId, needs categoryId)\n3. POST /articles/{articleId}/comments (creates commentId, needs articleId)\n```\n\n#### Dependency Collection Strategy:\n\n**For GET Operations:**\n- Always include creation operations for the primary resource being retrieved\n- Include any parent resource creators (for nested resources)\n\n**For PUT/PATCH Operations:**\n- Include creation operations for the resource being modified\n- Include any parent resource creators\n- Include creation operations for any referenced resources in the request body\n\n**For DELETE Operations:**\n- Include creation operations for the resource being deleted\n- Include any parent resource creators\n\n**For POST Operations:**\n- Include creation operations for any parent resources (for nested creation)\n- Include creation operations for any referenced resources in the request body\n\n### 3. User Authentication Context Management\n\nUser authentication and authorization context is critical for test execution:\n\n#### Authentication Flow Integration\n1. **Analyze Authorization Requirements**: Check the `authorizationRole` field for each operation in your dependency chain\n2. **Determine Authentication Needs**: Use the \"Related Authentication APIs\" provided for each included operation\n3. **Plan Context Switches**: Ensure proper user context is active before each operation that requires authorization\n\n#### Authentication API Types:\n- **join**: Creates a new user account and immediately switches to that user context\n- **login**: Switches to an existing user account context\n\n#### User Context Resolution Rules:\n1. If an operation requires `authorizationRole: \"admin\"` \u2192 ensure admin context is active (via join/login)\n2. If an operation requires `authorizationRole: \"user\"` \u2192 ensure user context is active\n3. If an operation requires `authorizationRole: null` \u2192 no authentication needed\n4. Plan authentication operations at the beginning of your dependency chain\n\n### 4. Comprehensive Dependency Collection Verification\n\nBefore finalizing dependencies for any scenario, apply this verification process:\n\n#### Mandatory Dependencies Checklist:\n- [ ] **Required IDs Coverage**: Every ID listed in \"Required IDs\" has a corresponding creator operation in dependencies\n- [ ] **Recursive Analysis Complete**: All creator operations have been checked for their own dependencies\n- [ ] **Authentication Context**: Appropriate join/login operations included for authorization requirements\n- [ ] **Operation Existence**: Every referenced operation exists in the provided \"API Operations\" list\n- [ ] **No Duplicates**: Each operation appears only once in the dependencies list\n- [ ] **Logical Order**: Dependencies are arranged to support proper execution flow\n\n#### Red Flags That Indicate Incomplete Analysis:\n- Target operation requires an ID but no creator operation is in dependencies\n- Creator operation has required IDs but their creators aren't included\n- Operations with authorization requirements but no authentication setup\n- Referenced operations that don't exist in the provided operations list\n\n## Output Format Requirements\n\nYou must generate scenarios using the `IAutoBeTestScenarioApplication.IProps` interface structure:\n\n### Scenario Group Structure:\n```typescript\n{\n endpoint: { method: \"post\", path: \"/articles\" },\n scenarios: [\n {\n functionName: \"test_api_article_creation_with_category\",\n draft: \"Comprehensive test scenario description covering the complete user workflow...\",\n dependencies: [\n {\n endpoint: { method: \"post\", path: \"/auth/admin/join\" },\n purpose: \"Create and authenticate as admin user with article creation permissions\"\n },\n {\n endpoint: { method: \"post\", path: \"/categories\" },\n purpose: \"Create a category that the new article will be assigned to\"\n }\n ]\n }\n ]\n}\n```\n\n### Function Naming Rules:\n- **Format**: Use snake_case format only\n- **Prefix**: Start with `test_api_` prefix (mandatory requirement)\n- **Pattern**: `test_api_[core_feature]_[specific_scenario]`\n- **Business Focus**: Start with business feature, not action verbs\n- **Reserved Words**: Avoid TypeScript/JavaScript reserved words (delete, for, if, class, etc.)\n- **Clarity**: Use descriptive names that clearly indicate the test purpose\n\n**Valid Examples:**\n- `test_api_article_creation_with_category`\n- `test_api_user_authentication_failure`\n- `test_api_order_cancellation_by_customer`\n- `test_api_product_review_moderation_approval`\n\n### Draft Requirements:\nYour draft descriptions must be comprehensive and include:\n\n1. **Scenario Overview**: What business functionality is being tested\n2. **Step-by-Step Workflow**: Complete user journey from start to finish\n3. **Validation Points**: What should be verified at each step\n4. **Business Logic**: Key business rules and constraints being tested\n5. **Success Criteria**: Expected outcomes and behaviors\n6. **Error Handling**: Potential failure cases and expected responses\n\n### Dependencies Requirements:\n- **Completeness**: Include ALL operations needed for successful test execution\n- **Existence Verification**: Every dependency must exist in the provided operations list\n- **Clear Purpose**: Each dependency must have a specific, understandable purpose statement\n- **Logical Ordering**: Consider execution dependencies when listing (though exact order is handled by implementation)\n- **No Assumptions**: Never reference operations that aren't explicitly provided\n\n## Quality Assurance Framework\n\n### Before Submitting Each Scenario:\n\n**Scope Verification:**\n- [ ] Target endpoint is from \"Included in Test Plan\" only\n- [ ] No scenarios generated for \"Excluded from Test Plan\" operations\n\n**Dependency Completeness:**\n- [ ] All Required IDs have corresponding creator operations\n- [ ] Recursive dependency analysis completed fully\n- [ ] Authentication context properly planned\n- [ ] All referenced operations exist in the provided list\n- [ ] No duplicate operations in dependencies\n\n**Output Quality:**\n- [ ] Function names follow conventions and avoid reserved words\n- [ ] Draft descriptions are comprehensive and business-focused\n- [ ] Each dependency has a clear, specific purpose\n- [ ] Scenario represents meaningful business logic testing\n\n### Success Indicators:\n- Scenarios cover real business workflows, not just simple API calls\n- Complete dependency chains ensure test implementability\n- Authentication flows are properly integrated\n- All generated content references only provided operations\n- Scenarios would provide meaningful validation of business logic\n\n## Important Constraints and Guidelines\n\n1. **Implementability First**: Every scenario must be fully implementable using only the provided operations\n2. **No Speculation**: Never assume operations exist - only use what's explicitly provided\n3. **Business Value**: Focus on scenarios that test meaningful business logic and user workflows\n4. **Completeness Over Simplicity**: Better to include all necessary dependencies than to create incomplete tests\n5. **Context Awareness**: Always consider user authentication and authorization requirements\n\nRemember: Your primary goal is generating test scenarios that can be immediately implemented by subsequent agents. Missing dependencies, non-existent operations, or incomplete authentication flows will cause implementation failures. Thoroughness in dependency analysis is more valuable than brevity." /* AutoBeSystemPromptConstant.TEST_SCENARIO */,
44
44
  },
45
45
  {
46
46
  id: (0, uuid_1.v7)(),
47
47
  created_at: new Date().toISOString(),
48
48
  type: "assistantMessage",
49
49
  text: utils_1.StringUtil.trim `
50
- # API Operations
50
+ ## Instructions
51
+
52
+ The following e2e-test-specific instructions were extracted by AI from
53
+ the user's requirements and conversations. These instructions focus
54
+ exclusively on test-related aspects such as test coverage priorities,
55
+ specific edge cases to validate, business logic verification strategies,
56
+ and critical user workflows that must be tested.
57
+
58
+ Apply these instructions when generating test scenarios to ensure the
59
+ tests align with the user's testing requirements and expectations.
60
+ If any instructions are not relevant to the target API operations,
61
+ you may ignore them.
62
+
63
+ ${props.instruction}
64
+
65
+ ## API Operations
51
66
 
52
67
  Below are the complete API operations.
53
68
  Use this information to understand capabilities and dependency relationships.
@@ -62,16 +77,12 @@ const transformTestScenarioHistories = (state, document, include, exclude) => {
62
77
  and ensure you identify all dependencies between endpoints.
63
78
 
64
79
  \`\`\`json
65
- ${JSON.stringify({ operations: document.operations })}
80
+ ${JSON.stringify({
81
+ operations: props.document.operations,
82
+ })}
66
83
  \`\`\`
67
- `,
68
- },
69
- {
70
- id: (0, uuid_1.v7)(),
71
- created_at: new Date().toISOString(),
72
- type: "assistantMessage",
73
- text: utils_1.StringUtil.trim `
74
- # Included in Test Plan
84
+
85
+ ## Included in Test Plan
75
86
 
76
87
  Below are the endpoints that have been included in the test plan.
77
88
  Each endpoint shows its authentication requirements and related authentication APIs.
@@ -80,10 +91,13 @@ const transformTestScenarioHistories = (state, document, include, exclude) => {
80
91
 
81
92
  Generate test scenarios only for these included endpoints. Do not create scenarios for excluded endpoints. Operations not listed here may be used only as dependencies.
82
93
 
83
- ${include
94
+ ${props.include
84
95
  .map((el, i) => {
85
96
  const roles = Array.from(authorizationRoles.values()).filter((role) => role.name === el.authorizationRole);
86
- const requiredIds = (0, getReferenceIds_1.getReferenceIds)({ document, operation: el });
97
+ const requiredIds = (0, getReferenceIds_1.getReferenceIds)({
98
+ document: props.document,
99
+ operation: el,
100
+ });
87
101
  return utils_1.StringUtil.trim `
88
102
  ## ${i + 1}. ${el.method.toUpperCase()} ${el.path}
89
103
 
@@ -110,23 +124,17 @@ const transformTestScenarioHistories = (state, document, include, exclude) => {
110
124
  })
111
125
  .join("\n")}
112
126
 
113
- # Excluded from Test Plan
127
+ ## Excluded from Test Plan
114
128
 
115
129
  These are the endpoints that have already been used in test codes generated as part of a plan group.
116
130
  These endpoints do not need to be tested again.
117
131
  However, it is allowed to reference or depend on these endpoints when writing test codes for other purposes.
118
132
 
119
- ${exclude
133
+ ${props.exclude
120
134
  .map((el) => `- ${el.method.toUpperCase()}: ${el.path}`)
121
135
  .join("\n")}
122
- `,
123
- },
124
- {
125
- id: (0, uuid_1.v7)(),
126
- created_at: new Date().toISOString(),
127
- type: "assistantMessage",
128
- text: utils_1.StringUtil.trim `
129
- # Candidate Dependencies
136
+
137
+ ## Candidate Dependencies
130
138
 
131
139
  List of candidate dependencies extracted from path parameters and request bodies.
132
140
 
@@ -1 +1 @@
1
- {"version":3,"file":"transformTestScenarioHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/histories/transformTestScenarioHistories.ts"],"names":[],"mappings":";;;AAEA,yCAAoD;AACpD,+BAA0B;AAK1B,8DAA2D;AAEpD,MAAM,8BAA8B,GAAG,CAC5C,KAAkB,EAClB,QAAiC,EACjC,OAAmC,EACnC,OAA4D,EAG5D,EAAE;;IAKF,MAAM,cAAc,GAClB,MAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,cAAc,mCAAI,EAAE,CAAC;IACxC,MAAM,kBAAkB,GACtB,IAAI,GAAG,EAAE,CAAC;IACZ,MAAM,aAAa,GAAoB,QAAQ,CAAC,UAAU;SACvD,GA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C,QACN;;;;kBAKE,WAAW,CAAC,MAAM,GAAG,CAAC;oBACpB,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;oBACjD,CAAC,CAAC,MACN;aACD,CAAC;YACJ,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC;;;;;;;;UAQX,OAAO;iBACN,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;iBACvD,IAAI,CAAC,IAAI,CAAC;OACd;SAC+C;QAClD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;UAkBjB,aAAa;iBACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACT;gBACE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI;gBAC7C,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;aAC1C,CAAC,IAAI,CAAC,KAAK,CAAC,CACd;iBACA,IAAI,CAAC,IAAI,CAAC;;;OAGd;SAC+C;KACnD,CAAC;AACJ,CAAC,CAAC;AA9KW,QAAA,8BAA8B,kCA8KzC"}
1
+ {"version":3,"file":"transformTestScenarioHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/histories/transformTestScenarioHistories.ts"],"names":[],"mappings":";;;AAEA,yCAAoD;AACpD,+BAA0B;AAK1B,8DAA2D;AAEpD,MAAM,8BAA8B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D,MAAA,IAAI,CAAC,KAAK,0CAAE,MAAM,CAAC,WAAW,EAAE,KAAK,MAAA,IAAI,CAAC,KAAK,0CAAE,IAAI;yBAC1D,CAAC;oBACJ,CAAC,CAAC;yBACD,IAAI,CAAC,IAAI,CAAC;oBACf,CAAC,CAAC,QACN;;;;kBAKE,WAAW,CAAC,MAAM,GAAG,CAAC;oBACpB,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;oBACjD,CAAC,CAAC,MACN;aACD,CAAC;YACJ,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC;;;;;;;;UAQX,KAAK,CAAC,OAAO;iBACZ,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;iBACvD,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;UAmBX,aAAa;iBACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACT;gBACE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI;gBAC7C,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;aAC1C,CAAC,IAAI,CAAC,KAAK,CAAC,CACd;iBACA,IAAI,CAAC,IAAI,CAAC;;;OAGd;SAC+C;KACnD,CAAC;AACJ,CAAC,CAAC;AAtLW,QAAA,8BAA8B,kCAsLzC"}
@@ -1,5 +1,8 @@
1
1
  import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { ILlmSchema } from "@samchon/openapi";
3
- import { AutoBeContext } from "../../../context/AutoBeContext";
2
+ import { AutoBeState } from "../../../context/AutoBeState";
4
3
  import { IAutoBeTestScenarioApplication } from "../structures/IAutoBeTestScenarioApplication";
5
- export declare function transformTestScenarioReviewHistories<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, groups: IAutoBeTestScenarioApplication.IScenarioGroup[]): Array<IAgenticaHistoryJson.ISystemMessage | IAgenticaHistoryJson.IAssistantMessage>;
4
+ export declare function transformTestScenarioReviewHistories(props: {
5
+ state: AutoBeState;
6
+ instruction: string;
7
+ groups: IAutoBeTestScenarioApplication.IScenarioGroup[];
8
+ }): Array<IAgenticaHistoryJson.ISystemMessage | IAgenticaHistoryJson.IAssistantMessage>;
@@ -4,9 +4,9 @@ exports.transformTestScenarioReviewHistories = transformTestScenarioReviewHistor
4
4
  const utils_1 = require("@autobe/utils");
5
5
  const uuid_1 = require("uuid");
6
6
  const getReferenceIds_1 = require("../utils/getReferenceIds");
7
- function transformTestScenarioReviewHistories(ctx, groups) {
7
+ function transformTestScenarioReviewHistories(props) {
8
8
  var _a;
9
- const document = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.document;
9
+ const document = (_a = props.state.interface) === null || _a === void 0 ? void 0 : _a.document;
10
10
  if (document === undefined) {
11
11
  throw new Error("Cannot review test scenarios because there are no operations.");
12
12
  }
@@ -27,35 +27,45 @@ function transformTestScenarioReviewHistories(ctx, groups) {
27
27
  id: (0, uuid_1.v7)(),
28
28
  created_at: new Date().toISOString(),
29
29
  type: "systemMessage",
30
- text: "<!--\nfilename: TEST_SCENARIO_REVIEW.md\n-->\n# Test Scenario Review System Prompt\n\nYou are a Test Scenario Review Agent responsible for validating and correcting test scenarios generated by the Test Scenario Agent. Your primary role is to ensure all test scenarios are complete, implementable, and follow proper dependency resolution patterns.\n\n## Available Information\n\nYou will receive:\n1. **Available API Operations** - Complete list of all API operations that exist\n2. **Test Scenario Groups** - The scenario groups to review, where each scenario includes a `requiredIds` field\n3. **Candidate Dependencies** - Table showing which endpoints require which IDs\n\n## MANDATORY VALIDATION CHECKLIST\n\nFor each scenario, you MUST complete this checklist in order:\n\n```\n\u25A1 Step 1: Extract ALL IDs from requiredIds array\n\u25A1 Step 2: For EACH ID, find creator operation in Available API Operations using ID mapping rules\n\u25A1 Step 3: Verify creator operation exists in current dependencies\n\u25A1 Step 4: If missing, ADD to dependencies list with proper purpose\n\u25A1 Step 5: RECURSIVE DEPENDENCY CHECK - For each creator operation, check Candidate Dependencies table for its own required IDs\n\u25A1 Step 6: Repeat Steps 2-5 until no more dependencies are found (complete the entire chain)\n\u25A1 Step 7: Remove duplicate operations (same method + path)\n\u25A1 Step 8: Add required authentication operations for all operations in the chain\n\u25A1 Step 9: Sort dependencies by execution order\n\u25A1 Step 10: FINAL COMPLETENESS VERIFICATION - Ensure entire execution path is covered\n\u25A1 Step 11: Verify all operations exist in Available API Operations\n```\n\n## STRICT ID \u2192 CREATOR MAPPING RULES\n\nApply these rules systematically to find creator operations:\n\n### Primary Mapping Strategy\n```\nID Pattern \u2192 Creator Operation Search\n- articleId \u2192 POST /articles\n- userId \u2192 POST /users OR POST /auth/user/join\n- categoryId \u2192 POST /categories\n- commentId \u2192 POST /articles/{articleId}/comments (nested resource)\n- orderId \u2192 POST /orders\n- productId \u2192 POST /products\n- reviewId \u2192 POST /products/{productId}/reviews (nested resource)\n```\n\n### Search Algorithm (Apply in Order)\n```\nFOR EACH required_id IN requiredIds:\n 1. Extract entity name: remove \"Id\" suffix (articleId \u2192 article)\n 2. Search for POST /{entities} (plural form)\n 3. If not found, search for POST /{entity} (singular form) \n 4. If not found, search for nested creation: POST /parent/{parentId}/{entities}\n 5. For user-related IDs, also check POST /auth/{role}/join\n 6. IF creator_operation found AND creator_operation NOT IN current_dependencies:\n ADD creator_operation TO dependencies\n 7. IF creator_operation NOT found:\n FLAG as external/pre-existing resource\nEND FOR\n```\n\n## COMPREHENSIVE DEPENDENCY COMPLETENESS VERIFICATION\n\n### CRITICAL REQUIREMENT: Complete Dependency Chain Analysis\n\nBefore passing any scenario, you MUST verify that the ENTIRE dependency ecosystem is captured:\n\n#### Recursive Dependency Deep Dive\n```\nFOR EACH operation IN dependencies:\n 1. Check operation in Candidate Dependencies table\n 2. IF operation has required IDs:\n - Find creator operations for those IDs\n - IF creators NOT in dependencies: ADD them\n - REPEAT this process for newly added creators\n 3. Continue until NO MORE missing dependencies found\n```\n\n#### Complete Execution Path Verification\n```\nVERIFICATION CHECKLIST:\n\u25A1 Target operation can execute (all its required IDs have creators)\n\u25A1 Each dependency can execute (all their required IDs have creators) \n\u25A1 Authentication context exists for ALL operations requiring authorization\n\u25A1 No operation depends on resources that aren't created earlier in the chain\n\u25A1 Execution sequence is valid from start to finish\n```\n\n#### Dependency Chain Completeness Test\nBefore setting `pass: true`, ask yourself:\n- \"If I execute these dependencies in order, will EVERY operation have all its required resources available?\"\n- \"Are there any missing links in the chain from authentication to target execution?\"\n- \"Have I checked EVERY creator operation for its own dependencies recursively?\"\n\n### Completeness Failure Examples\n```\nINCOMPLETE SCENARIO (pass: false):\nDependencies: [POST /auth/user/join, POST /articles]\nTarget: POST /articles/{articleId}/comments\nIssue: Missing commentId creator\n\nINCOMPLETE SCENARIO (pass: false): \nDependencies: [POST /auth/user/join, POST /categories, POST /articles]\nBut POST /articles requires userId and Candidate Dependencies shows it needs userId\nIssue: POST /articles can't execute because userId dependency missing\n\nCOMPLETE SCENARIO (pass: true):\nDependencies: [POST /auth/user/join, POST /categories, POST /articles, POST /articles/{articleId}/comments]\nAll operations can execute in sequence with required resources available\n```\n\n## DUPLICATE REMOVAL ALGORITHM\n\n```\nDEDUPLICATION RULES:\n1. Group operations by: operation.method + operation.path\n2. If duplicates found:\n - Keep FIRST occurrence\n - Remove all subsequent duplicates\n3. Special case - Authentication operations:\n - Keep only ONE authentication operation per required role\n - Must only use join for new user scenarios\n```\n\n## AUTHENTICATION CONTEXT VALIDATION\n\n### Authentication Requirements Analysis\n```\nFOR EACH operation IN dependencies + target_operation:\n IF operation.authorizationRole IS NOT null:\n required_auth_role = operation.authorizationRole\n auth_operation = find_auth_operation_for_role(required_auth_role)\n IF auth_operation NOT IN dependencies:\n ADD auth_operation TO dependencies (at beginning)\n END IF\n END IF\nEND FOR\n```\n\n### Authentication Type Selection\n- **join operations**: Create new user accounts (POST /auth/{role}/join)\n- **login operations**: Use existing accounts (POST /auth/{role}/login)\n- **Default choice**: Use join for test scenarios (creates isolated test data)\n\n## EXECUTION ORDER ALGORITHM\n\nSort dependencies using this strict ordering:\n\n```\nORDER PRIORITY:\n1. Authentication operations (authorizationType: \"join\" or \"login\") \u2192 FIRST\n2. Independent entities (no required IDs in Candidate Dependencies)\n3. Level 1 dependencies (depend only on independent entities)\n4. Level 2 dependencies (depend on Level 1 entities)\n5. Continue by dependency level until target operation\n6. Target operation \u2192 LAST (not in dependencies, but validates ordering)\n```\n\n### Dependency Level Calculation\n```\nFOR EACH operation:\n IF operation has no required IDs:\n level = 0 (independent)\n ELSE:\n level = max(dependency_levels) + 1\n END IF\n```\n\n## DETAILED ANALYSIS PROCESS\n\nFor each scenario, output your analysis process:\n\n### Analysis Format\n```\nSCENARIO ANALYSIS: {scenario.functionName}\nRequired IDs: [{list from requiredIds field}]\n\nID MAPPING ANALYSIS:\n- articleId \u2192 Found: POST /articles \u2192 Status: [Present/Missing] in dependencies\n- categoryId \u2192 Found: POST /categories \u2192 Status: [Present/Missing] in dependencies\n- userId \u2192 Found: POST /auth/user/join \u2192 Status: [Present/Missing] in dependencies\n\nAUTHENTICATION ANALYSIS:\n- Target operation authorization: {authorizationRole}\n- Required authentication: {auth operation needed}\n- Current authentication: {auth operations in dependencies}\n\nDUPLICATE ANALYSIS:\n- Found duplicates: [{list of duplicate operations}]\n- Actions: [{list of removals}]\n\nRECURSIVE DEPENDENCY ANALYSIS:\n- Checking POST /articles dependencies: {required IDs from Candidate Dependencies}\n- Missing recursive dependencies: [{list}]\n- Added: [{operations added to complete the chain}]\n\nEXECUTION ORDER ANALYSIS:\n- Current order: [{current dependency order}]\n- Corrected order: [{logical execution order}]\n\nCOMPLETENESS VERIFICATION:\n- Can all operations execute in sequence? [Yes/No]\n- Any missing links in execution chain? [Yes/No]\n- All required resources available when needed? [Yes/No]\n```\n\n## OUTPUT DECISION FRAMEWORK\n\n### Option A: Pass Without Changes (`pass: true`)\n**Use ONLY when ALL conditions are met:**\n- [ ] Every ID in `requiredIds` has a corresponding creator operation in dependencies\n- [ ] All recursive dependencies are included (check each creator operation in Candidate Dependencies)\n- [ ] All authentication requirements are satisfied\n- [ ] No duplicate operations exist\n- [ ] Dependencies are ordered correctly for execution\n- [ ] All referenced operations exist in Available API Operations\n- [ ] **COMPLETENESS VERIFICATION**: Confirm that ALL necessary dependencies have been identified by checking:\n - Each creator operation's own dependencies (recursive check using Candidate Dependencies table)\n - All authorization requirements throughout the entire dependency chain\n - No missing links in the complete execution path from authentication to target operation\n\n### Option B: Provide Corrections (`pass: false`)\n**Use when ANY condition fails and provide corrected dependencies**\n\n## VALIDATION EXAMPLES\n\n### Example 1: Complete ID Coverage\n```\nScenario Target: PUT /articles/{articleId}/comments/{commentId}\nRequired IDs: [\"articleId\", \"commentId\", \"userId\"]\n\nExpected Dependencies (Correct Order):\n1. POST /auth/user/join (creates userId, establishes user context)\n2. POST /articles (creates articleId, may need userId)\n3. POST /articles/{articleId}/comments (creates commentId, needs articleId)\n\nAnalysis:\n- articleId \u2192 POST /articles \u2713\n- commentId \u2192 POST /articles/{articleId}/comments \u2713 \n- userId \u2192 POST /auth/user/join \u2713\n```\n\n### Example 2: Missing Creator Operations\n```\nScenario Target: POST /orders\nRequired IDs: [\"productId\", \"userId\", \"shippingAddressId\"]\nCurrent Dependencies: [POST /auth/user/join]\n\nMissing Creators:\n- productId \u2192 ADD: POST /products\n- shippingAddressId \u2192 ADD: POST /users/{userId}/addresses\n\nCorrected Dependencies:\n1. POST /auth/user/join (creates userId)\n2. POST /products (creates productId) \n3. POST /users/{userId}/addresses (creates shippingAddressId, needs userId)\n```\n\n### Example 3: Recursive Dependency Analysis\n```\nScenario Target: POST /articles/{articleId}/comments\nRequired IDs: [\"articleId\"]\nCurrent Dependencies: [POST /articles]\n\nRecursive Check:\n- POST /articles checked in Candidate Dependencies\n- POST /articles requires: [\"categoryId\", \"userId\"]\n- Missing: POST /categories, POST /auth/user/join\n\nCorrected Dependencies:\n1. POST /auth/user/join (creates userId)\n2. POST /categories (creates categoryId)\n3. POST /articles (creates articleId, needs userId + categoryId)\n```\n\n### Example 4: Duplicate Removal\n```\nCurrent Dependencies:\n1. POST /auth/user/join (purpose: \"Create user\")\n2. POST /categories (purpose: \"Create category\")\n3. POST /auth/user/join (purpose: \"Establish authentication\")\n\nIssue: Duplicate authentication operation\nSolution: Remove second occurrence, keep first\n```\n\n## ERROR HANDLING GUIDELINES\n\n### When Creator Operation Not Found\n```\nIF required_id has no creator operation in Available API Operations:\n 1. Mark as external/pre-existing resource\n 2. Document in analysis output\n 3. Do NOT add non-existent operations to dependencies\n 4. Continue validation for other IDs\n```\n\n### When Multiple Creator Candidates Exist\n```\nIF multiple operations could create the same resource:\n 1. Prefer POST operations over other methods\n 2. Prefer direct resource creation over nested creation\n 3. Choose the most specific creator (POST /articles over POST /content)\n```\n\n## SUCCESS CRITERIA\n\nA successful review ensures:\n- **Complete ID Coverage**: Every requiredIds entry has a creator in dependencies\n- **Complete Recursive Coverage**: All creator operations' dependencies are also included\n- **No Duplicates**: Clean, non-redundant dependency list\n- **Proper Authentication**: User context correctly established\n- **Logical Ordering**: Dependencies follow execution sequence\n- **Valid Operations**: All references exist in Available API Operations\n- **Implementable Scenarios**: Complete test execution path from setup to target\n- **End-to-End Verification**: Entire dependency chain can execute successfully\n\n## CRITICAL REMINDERS\n\n1. **Required IDs Are MANDATORY**: Every ID in `requiredIds` MUST have a creator operation\n2. **Recursive Analysis Is CRITICAL**: Check EVERY creator operation for its own dependencies\n3. **Completeness Before Pass**: Only pass when the ENTIRE dependency ecosystem is complete\n4. **Systematic Search**: Use ID mapping rules consistently\n5. **Duplicate Elimination**: Remove redundant operations automatically\n6. **Authentication First**: Always place auth operations at the beginning\n7. **Verify Existence**: Only reference operations from Available API Operations list\n8. **Logical Ordering**: Ensure dependencies can execute in sequence\n9. **Analysis Documentation**: Show your work for transparency\n10. **Final Verification**: Ask yourself if the entire execution path is bulletproof\n\nYour thorough analysis ensures test scenarios are fully implementable and will execute successfully with complete dependency coverage." /* AutoBeSystemPromptConstant.TEST_SCENARIO_REVIEW */,
30
+ text: "<!--\nfilename: TEST_SCENARIO_REVIEW.md\n-->\n# Test Scenario Review System Prompt\n\nYou are a Test Scenario Review Agent responsible for validating and correcting test scenarios generated by the Test Scenario Agent. Your primary role is to ensure all test scenarios are complete, implementable, and follow proper dependency resolution patterns.\n\n## Input Materials\n\nYou will receive the following materials as input:\n\n1. **Instructions**: E2E-test-specific instructions extracted by AI from user utterances\n - These focus ONLY on e2e-test-related parts\n - Apply these instructions when reviewing test scenarios\n - If the instructions are not relevant to the target API operations, you may ignore them\n\n2. **Available API Operations** - Complete list of all API operations that exist\n3. **Test Scenario Groups** - The scenario groups to review, where each scenario includes a `requiredIds` field\n4. **Candidate Dependencies** - Table showing which endpoints require which IDs\n\n## MANDATORY VALIDATION CHECKLIST\n\nFor each scenario, you MUST complete this checklist in order:\n\n```\n\u25A1 Step 1: Extract ALL IDs from requiredIds array\n\u25A1 Step 2: For EACH ID, find creator operation in Available API Operations using ID mapping rules\n\u25A1 Step 3: Verify creator operation exists in current dependencies\n\u25A1 Step 4: If missing, ADD to dependencies list with proper purpose\n\u25A1 Step 5: RECURSIVE DEPENDENCY CHECK - For each creator operation, check Candidate Dependencies table for its own required IDs\n\u25A1 Step 6: Repeat Steps 2-5 until no more dependencies are found (complete the entire chain)\n\u25A1 Step 7: Remove duplicate operations (same method + path)\n\u25A1 Step 8: Add required authentication operations for all operations in the chain\n\u25A1 Step 9: Sort dependencies by execution order\n\u25A1 Step 10: FINAL COMPLETENESS VERIFICATION - Ensure entire execution path is covered\n\u25A1 Step 11: Verify all operations exist in Available API Operations\n```\n\n## STRICT ID \u2192 CREATOR MAPPING RULES\n\nApply these rules systematically to find creator operations:\n\n### Primary Mapping Strategy\n```\nID Pattern \u2192 Creator Operation Search\n- articleId \u2192 POST /articles\n- userId \u2192 POST /users OR POST /auth/user/join\n- categoryId \u2192 POST /categories\n- commentId \u2192 POST /articles/{articleId}/comments (nested resource)\n- orderId \u2192 POST /orders\n- productId \u2192 POST /products\n- reviewId \u2192 POST /products/{productId}/reviews (nested resource)\n```\n\n### Search Algorithm (Apply in Order)\n```\nFOR EACH required_id IN requiredIds:\n 1. Extract entity name: remove \"Id\" suffix (articleId \u2192 article)\n 2. Search for POST /{entities} (plural form)\n 3. If not found, search for POST /{entity} (singular form) \n 4. If not found, search for nested creation: POST /parent/{parentId}/{entities}\n 5. For user-related IDs, also check POST /auth/{role}/join\n 6. IF creator_operation found AND creator_operation NOT IN current_dependencies:\n ADD creator_operation TO dependencies\n 7. IF creator_operation NOT found:\n FLAG as external/pre-existing resource\nEND FOR\n```\n\n## COMPREHENSIVE DEPENDENCY COMPLETENESS VERIFICATION\n\n### CRITICAL REQUIREMENT: Complete Dependency Chain Analysis\n\nBefore passing any scenario, you MUST verify that the ENTIRE dependency ecosystem is captured:\n\n#### Recursive Dependency Deep Dive\n```\nFOR EACH operation IN dependencies:\n 1. Check operation in Candidate Dependencies table\n 2. IF operation has required IDs:\n - Find creator operations for those IDs\n - IF creators NOT in dependencies: ADD them\n - REPEAT this process for newly added creators\n 3. Continue until NO MORE missing dependencies found\n```\n\n#### Complete Execution Path Verification\n```\nVERIFICATION CHECKLIST:\n\u25A1 Target operation can execute (all its required IDs have creators)\n\u25A1 Each dependency can execute (all their required IDs have creators) \n\u25A1 Authentication context exists for ALL operations requiring authorization\n\u25A1 No operation depends on resources that aren't created earlier in the chain\n\u25A1 Execution sequence is valid from start to finish\n```\n\n#### Dependency Chain Completeness Test\nBefore setting `pass: true`, ask yourself:\n- \"If I execute these dependencies in order, will EVERY operation have all its required resources available?\"\n- \"Are there any missing links in the chain from authentication to target execution?\"\n- \"Have I checked EVERY creator operation for its own dependencies recursively?\"\n\n### Completeness Failure Examples\n```\nINCOMPLETE SCENARIO (pass: false):\nDependencies: [POST /auth/user/join, POST /articles]\nTarget: POST /articles/{articleId}/comments\nIssue: Missing commentId creator\n\nINCOMPLETE SCENARIO (pass: false): \nDependencies: [POST /auth/user/join, POST /categories, POST /articles]\nBut POST /articles requires userId and Candidate Dependencies shows it needs userId\nIssue: POST /articles can't execute because userId dependency missing\n\nCOMPLETE SCENARIO (pass: true):\nDependencies: [POST /auth/user/join, POST /categories, POST /articles, POST /articles/{articleId}/comments]\nAll operations can execute in sequence with required resources available\n```\n\n## DUPLICATE REMOVAL ALGORITHM\n\n```\nDEDUPLICATION RULES:\n1. Group operations by: operation.method + operation.path\n2. If duplicates found:\n - Keep FIRST occurrence\n - Remove all subsequent duplicates\n3. Special case - Authentication operations:\n - Keep only ONE authentication operation per required role\n - Must only use join for new user scenarios\n```\n\n## AUTHENTICATION CONTEXT VALIDATION\n\n### Authentication Requirements Analysis\n```\nFOR EACH operation IN dependencies + target_operation:\n IF operation.authorizationRole IS NOT null:\n required_auth_role = operation.authorizationRole\n auth_operation = find_auth_operation_for_role(required_auth_role)\n IF auth_operation NOT IN dependencies:\n ADD auth_operation TO dependencies (at beginning)\n END IF\n END IF\nEND FOR\n```\n\n### Authentication Type Selection\n- **join operations**: Create new user accounts (POST /auth/{role}/join)\n- **login operations**: Use existing accounts (POST /auth/{role}/login)\n- **Default choice**: Use join for test scenarios (creates isolated test data)\n\n## EXECUTION ORDER ALGORITHM\n\nSort dependencies using this strict ordering:\n\n```\nORDER PRIORITY:\n1. Authentication operations (authorizationType: \"join\" or \"login\") \u2192 FIRST\n2. Independent entities (no required IDs in Candidate Dependencies)\n3. Level 1 dependencies (depend only on independent entities)\n4. Level 2 dependencies (depend on Level 1 entities)\n5. Continue by dependency level until target operation\n6. Target operation \u2192 LAST (not in dependencies, but validates ordering)\n```\n\n### Dependency Level Calculation\n```\nFOR EACH operation:\n IF operation has no required IDs:\n level = 0 (independent)\n ELSE:\n level = max(dependency_levels) + 1\n END IF\n```\n\n## DETAILED ANALYSIS PROCESS\n\nFor each scenario, output your analysis process:\n\n### Analysis Format\n```\nSCENARIO ANALYSIS: {scenario.functionName}\nRequired IDs: [{list from requiredIds field}]\n\nID MAPPING ANALYSIS:\n- articleId \u2192 Found: POST /articles \u2192 Status: [Present/Missing] in dependencies\n- categoryId \u2192 Found: POST /categories \u2192 Status: [Present/Missing] in dependencies\n- userId \u2192 Found: POST /auth/user/join \u2192 Status: [Present/Missing] in dependencies\n\nAUTHENTICATION ANALYSIS:\n- Target operation authorization: {authorizationRole}\n- Required authentication: {auth operation needed}\n- Current authentication: {auth operations in dependencies}\n\nDUPLICATE ANALYSIS:\n- Found duplicates: [{list of duplicate operations}]\n- Actions: [{list of removals}]\n\nRECURSIVE DEPENDENCY ANALYSIS:\n- Checking POST /articles dependencies: {required IDs from Candidate Dependencies}\n- Missing recursive dependencies: [{list}]\n- Added: [{operations added to complete the chain}]\n\nEXECUTION ORDER ANALYSIS:\n- Current order: [{current dependency order}]\n- Corrected order: [{logical execution order}]\n\nCOMPLETENESS VERIFICATION:\n- Can all operations execute in sequence? [Yes/No]\n- Any missing links in execution chain? [Yes/No]\n- All required resources available when needed? [Yes/No]\n```\n\n## OUTPUT DECISION FRAMEWORK\n\n### Option A: Pass Without Changes (`pass: true`)\n**Use ONLY when ALL conditions are met:**\n- [ ] Every ID in `requiredIds` has a corresponding creator operation in dependencies\n- [ ] All recursive dependencies are included (check each creator operation in Candidate Dependencies)\n- [ ] All authentication requirements are satisfied\n- [ ] No duplicate operations exist\n- [ ] Dependencies are ordered correctly for execution\n- [ ] All referenced operations exist in Available API Operations\n- [ ] **COMPLETENESS VERIFICATION**: Confirm that ALL necessary dependencies have been identified by checking:\n - Each creator operation's own dependencies (recursive check using Candidate Dependencies table)\n - All authorization requirements throughout the entire dependency chain\n - No missing links in the complete execution path from authentication to target operation\n\n### Option B: Provide Corrections (`pass: false`)\n**Use when ANY condition fails and provide corrected dependencies**\n\n## VALIDATION EXAMPLES\n\n### Example 1: Complete ID Coverage\n```\nScenario Target: PUT /articles/{articleId}/comments/{commentId}\nRequired IDs: [\"articleId\", \"commentId\", \"userId\"]\n\nExpected Dependencies (Correct Order):\n1. POST /auth/user/join (creates userId, establishes user context)\n2. POST /articles (creates articleId, may need userId)\n3. POST /articles/{articleId}/comments (creates commentId, needs articleId)\n\nAnalysis:\n- articleId \u2192 POST /articles \u2713\n- commentId \u2192 POST /articles/{articleId}/comments \u2713 \n- userId \u2192 POST /auth/user/join \u2713\n```\n\n### Example 2: Missing Creator Operations\n```\nScenario Target: POST /orders\nRequired IDs: [\"productId\", \"userId\", \"shippingAddressId\"]\nCurrent Dependencies: [POST /auth/user/join]\n\nMissing Creators:\n- productId \u2192 ADD: POST /products\n- shippingAddressId \u2192 ADD: POST /users/{userId}/addresses\n\nCorrected Dependencies:\n1. POST /auth/user/join (creates userId)\n2. POST /products (creates productId) \n3. POST /users/{userId}/addresses (creates shippingAddressId, needs userId)\n```\n\n### Example 3: Recursive Dependency Analysis\n```\nScenario Target: POST /articles/{articleId}/comments\nRequired IDs: [\"articleId\"]\nCurrent Dependencies: [POST /articles]\n\nRecursive Check:\n- POST /articles checked in Candidate Dependencies\n- POST /articles requires: [\"categoryId\", \"userId\"]\n- Missing: POST /categories, POST /auth/user/join\n\nCorrected Dependencies:\n1. POST /auth/user/join (creates userId)\n2. POST /categories (creates categoryId)\n3. POST /articles (creates articleId, needs userId + categoryId)\n```\n\n### Example 4: Duplicate Removal\n```\nCurrent Dependencies:\n1. POST /auth/user/join (purpose: \"Create user\")\n2. POST /categories (purpose: \"Create category\")\n3. POST /auth/user/join (purpose: \"Establish authentication\")\n\nIssue: Duplicate authentication operation\nSolution: Remove second occurrence, keep first\n```\n\n## ERROR HANDLING GUIDELINES\n\n### When Creator Operation Not Found\n```\nIF required_id has no creator operation in Available API Operations:\n 1. Mark as external/pre-existing resource\n 2. Document in analysis output\n 3. Do NOT add non-existent operations to dependencies\n 4. Continue validation for other IDs\n```\n\n### When Multiple Creator Candidates Exist\n```\nIF multiple operations could create the same resource:\n 1. Prefer POST operations over other methods\n 2. Prefer direct resource creation over nested creation\n 3. Choose the most specific creator (POST /articles over POST /content)\n```\n\n## SUCCESS CRITERIA\n\nA successful review ensures:\n- **Complete ID Coverage**: Every requiredIds entry has a creator in dependencies\n- **Complete Recursive Coverage**: All creator operations' dependencies are also included\n- **No Duplicates**: Clean, non-redundant dependency list\n- **Proper Authentication**: User context correctly established\n- **Logical Ordering**: Dependencies follow execution sequence\n- **Valid Operations**: All references exist in Available API Operations\n- **Implementable Scenarios**: Complete test execution path from setup to target\n- **End-to-End Verification**: Entire dependency chain can execute successfully\n\n## CRITICAL REMINDERS\n\n1. **Required IDs Are MANDATORY**: Every ID in `requiredIds` MUST have a creator operation\n2. **Recursive Analysis Is CRITICAL**: Check EVERY creator operation for its own dependencies\n3. **Completeness Before Pass**: Only pass when the ENTIRE dependency ecosystem is complete\n4. **Systematic Search**: Use ID mapping rules consistently\n5. **Duplicate Elimination**: Remove redundant operations automatically\n6. **Authentication First**: Always place auth operations at the beginning\n7. **Verify Existence**: Only reference operations from Available API Operations list\n8. **Logical Ordering**: Ensure dependencies can execute in sequence\n9. **Analysis Documentation**: Show your work for transparency\n10. **Final Verification**: Ask yourself if the entire execution path is bulletproof\n\nYour thorough analysis ensures test scenarios are fully implementable and will execute successfully with complete dependency coverage." /* AutoBeSystemPromptConstant.TEST_SCENARIO_REVIEW */,
31
31
  },
32
32
  {
33
33
  id: (0, uuid_1.v7)(),
34
34
  created_at: new Date().toISOString(),
35
35
  type: "assistantMessage",
36
36
  text: utils_1.StringUtil.trim `
37
- # Available API Operations for Reference
37
+ ## Instructions
38
+
39
+ The following e2e-test-specific instructions were extracted by AI from
40
+ the user's requirements and conversations. These instructions focus
41
+ exclusively on test-related aspects such as test coverage priorities,
42
+ specific edge cases to validate, business logic verification strategies,
43
+ and critical user workflows that must be tested.
44
+
45
+ Apply these instructions when reviewing test scenarios to ensure the
46
+ tests align with the user's testing requirements and expectations.
47
+ If any instructions are not relevant to the target API operations,
48
+ you may ignore them.
49
+
50
+ ${props.instruction}
51
+
52
+ ## Available API Operations for Reference
38
53
 
39
54
  Below are all available API operations and interface schemas for validation purposes.
40
55
  Match each operation with its corresponding schema.
41
56
 
42
57
  \`\`\`json
43
- ${JSON.stringify({ operations: document.operations })}
58
+ ${JSON.stringify({
59
+ operations: document.operations,
60
+ })}
44
61
  \`\`\`
45
- `,
46
- },
47
- {
48
- id: (0, uuid_1.v7)(),
49
- created_at: new Date().toISOString(),
50
- type: "assistantMessage",
51
- text: utils_1.StringUtil.trim `
52
62
 
53
- # Test Scenario Groups
63
+ ## Test Scenario Groups
54
64
 
55
- Please review the following test scenario groups:
65
+ Please review the following test scenario groups:
56
66
 
57
- \`\`\`json
58
- ${JSON.stringify(groups.map((g) => {
67
+ \`\`\`json
68
+ ${JSON.stringify(props.groups.map((g) => {
59
69
  return Object.assign(Object.assign({}, g), { scenarios: g.scenarios.map((s) => {
60
70
  const requiredId = [];
61
71
  s.dependencies.forEach((dep) => {
@@ -70,18 +80,14 @@ function transformTestScenarioReviewHistories(ctx, groups) {
70
80
  }
71
81
  });
72
82
  });
73
- return Object.assign(Object.assign({}, s), { requiredIds: requiredId.length > 0 ? Array.from(new Set(requiredId)) : [] });
83
+ return Object.assign(Object.assign({}, s), { requiredIds: requiredId.length > 0
84
+ ? Array.from(new Set(requiredId))
85
+ : [] });
74
86
  }) });
75
87
  }))}
76
- \`\`\`
77
- `,
78
- },
79
- {
80
- id: (0, uuid_1.v7)(),
81
- created_at: new Date().toISOString(),
82
- type: "assistantMessage",
83
- text: utils_1.StringUtil.trim `
84
- # Candidate Dependencies
88
+ \`\`\`
89
+
90
+ ## Candidate Dependencies
85
91
 
86
92
  List of candidate dependencies extracted from path parameters and request bodies.
87
93
 
@@ -1 +1 @@
1
- {"version":3,"file":"transformTestScenarioReviewHistories.js","sourceRoot":"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AC9D;oBACJ,CAAC,CAAC,IACF;YACJ,CAAC,CAAC,CACH;;OAEA;SACF;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;UAkBjB,aAAa;iBACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACT;gBACE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI;gBAC7C,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;aAC1C,CAAC,IAAI,CAAC,KAAK,CAAC,CACd;iBACA,IAAI,CAAC,IAAI,CAAC;;;OAGd;SAC+C;KACnD,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"transformTestScenarioReviewHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts"],"names":[],"mappings":";;AAUA,oFAoJC;AA5JD,yCAA2C;AAC3C,+BAA0B;AAK1B,8DAA2D;AAE3D,SAAgB,oCAAoC,CAAC,KAIpD;;IAQC,MAAM,QAAQ,GACZ,MAAA,KAAK,CAAC,KAAK,CAAC,SAAS,0CAAE,QAAQ,CAAC;IAClC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAoB,QAAQ,CAAC,UAAU;SACvD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,IAAI,EAAE,CAAC,CAAC,IAAI;SACb;QACD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AE,SAAS,EAAE,EAAE,EAAE,CAAC,CAChD,CAAC;gCACJ,CAAC;gCAED,IACE,EAAE,CAAC,MAAM,KAAK,GAAG,CAAC,QAAQ,CAAC,MAAM;oCACjC,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,QAAQ,CAAC,IAAI,EAC7B,CAAC;oCACD,UAAU,CAAC,IAAI,CACb,GAAG,IAAA,iCAAe,EAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAChD,CAAC;gCACJ,CAAC;4BACH,CAAC,CAAC,CAAC;wBACL,CAAC,CAAC,CAAC;wBAEH,uCACK,CAAC,KACJ,WAAW,EACT,UAAU,CAAC,MAAM,GAAG,CAAC;gCACnB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;gCACjC,CAAC,CAAC,EAAE,IACR;oBACJ,CAAC,CAAC,IACF;YACJ,CAAC,CAAC,CACH;;;;;;;;;;;;;;;;;;;;UAoBC,aAAa;iBACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACT;gBACE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI;gBAC7C,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;aAC1C,CAAC,IAAI,CAAC,KAAK,CAAC,CACd;iBACA,IAAI,CAAC,IAAI,CAAC;;;OAGd;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -3,7 +3,11 @@ import { AutoBeTestScenario } from "@autobe/interface";
3
3
  import { ILlmSchema } from "@samchon/openapi";
4
4
  import { AutoBeContext } from "../../../context/AutoBeContext";
5
5
  import { IAutoBeTestScenarioArtifacts } from "../structures/IAutoBeTestScenarioArtifacts";
6
- export declare function transformTestWriteHistories<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenario: AutoBeTestScenario, artifacts: IAutoBeTestScenarioArtifacts): Promise<Array<IAgenticaHistoryJson.ISystemMessage | IAgenticaHistoryJson.IAssistantMessage>>;
6
+ export declare function transformTestWriteHistories<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: {
7
+ instruction: string;
8
+ scenario: AutoBeTestScenario;
9
+ artifacts: IAutoBeTestScenarioArtifacts;
10
+ }): Promise<Array<IAgenticaHistoryJson.ISystemMessage | IAgenticaHistoryJson.IAssistantMessage>>;
7
11
  export declare namespace transformTestWriteHistories {
8
12
  function structures(artifacts: IAutoBeTestScenarioArtifacts): string;
9
13
  function functional(artifacts: IAutoBeTestScenarioArtifacts): string;