@autobe/agent 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/agent/src/AutoBeMockAgent.js +1 -0
- package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +10 -9
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/agent/src/context/AutoBeContext.d.ts +2 -2
- package/lib/agent/src/factory/createAutoBeContext.js +3 -1
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +33 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +6 -6
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +5 -3
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +365 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +6 -6
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1633 -1198
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +60 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js +3 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +40 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +4 -4
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js +2 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +4 -4
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +7 -2
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +41 -25
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +118 -96
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +10 -10
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +10 -9
- package/lib/context/AutoBeContext.d.ts +2 -2
- package/lib/index.mjs +2315 -1526
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +60 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +40 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +2 -2
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +7 -2
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
- package/package.json +6 -6
- package/src/AutoBeMockAgent.ts +1 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +10 -9
- package/src/context/AutoBeContext.ts +2 -0
- package/src/factory/createAutoBeContext.ts +2 -1
- package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +39 -0
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +5 -1
- package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +95 -0
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +118 -10
- package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.ts +65 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +42 -0
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +7 -3
- package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts +6 -2
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +10 -5
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +2 -0
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +46 -34
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +24 -4
- package/src/orchestrate/test/orchestrateTestCorrect.ts +5 -1
- package/src/orchestrate/test/orchestrateTestWrite.ts +1 -1
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +28 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +0 -75
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +0 -1
- package/lib/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
- package/src/orchestrate/test/histories/transformTestHistories.ts +0 -78
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateInterfaceOperationsReview.js","sourceRoot":"","sources":["../../../../../src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateInterfaceOperationsReview.js","sourceRoot":"","sources":["../../../../../src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,oFA0DC;;;AAjED,kDAA0B;AAC1B,+BAA0B;AAG1B,yHAAsH;AAGtH,SAAsB,oCAAoC,CAGxD,GAAyB,EACzB,UAAsC,EACtC,QAAiC;;;QAEjC,IAAI,CAAC;YACH,MAAM,KAAK,GAAyB,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,0CAAE,MAAM,CAAC,IAAI,CAAC,KAAM,CAAC;YAC3E,MAAM,OAAO,GACX;gBACE,KAAK,EAAE,IAAI;aACZ,CAAC;YACJ,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC;gBAC1C,MAAM,EAAE,2BAA2B;gBACnC,SAAS,EAAE,IAAA,yFAA2C,EAAC,GAAG,EAAE,UAAU,CAAC;gBACvE,UAAU,EAAE,sBAAsB,CAAC;oBACjC,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,aAAa,EAAE,KAAK;oBACpB,KAAK,EAAE,CAAC,IAAwD,EAAE,EAAE;wBAClE,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;oBACvB,CAAC;iBACF,CAAC;gBACF,mBAAmB,EAAE,KAAK;gBAC1B,OAAO,EAAE,uBAAuB;aACjC,CAAC,CAAC;YACH,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;gBAC3B,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;gBAC9C,QAAQ,CAAC,SAAS,IAAI,UAAU,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uHAI5B;YACA,QAAQ,EAAE;gBACR,gBAAgB,EAAE,QAAQ;aAC3B;SACF;;QAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for reviewing and refining API endpoints through holistic analysis.
|
|
4
|
+
*
|
|
5
|
+
* This application performs comprehensive review of all endpoints generated
|
|
6
|
+
* through divide-and-conquer strategy, ensuring consistency, eliminating
|
|
7
|
+
* redundancy, and preventing over-engineering across the entire API surface.
|
|
8
|
+
*/
|
|
9
|
+
export interface IAutoBeInterfaceEndpointsReviewApplication {
|
|
10
|
+
/**
|
|
11
|
+
* Reviews and refines the complete collection of API endpoints.
|
|
12
|
+
*
|
|
13
|
+
* This method consolidates all endpoints generated independently by different
|
|
14
|
+
* groups and performs holistic review to:
|
|
15
|
+
* - Ensure naming consistency across all endpoints
|
|
16
|
+
* - Remove duplicate or overlapping endpoints
|
|
17
|
+
* - Eliminate over-engineered solutions
|
|
18
|
+
* - Standardize path structures and HTTP methods
|
|
19
|
+
* - Verify REST API design principles
|
|
20
|
+
*
|
|
21
|
+
* The review process examines the entire API as a cohesive system rather
|
|
22
|
+
* than individual endpoints, ensuring the final API is intuitive, maintainable,
|
|
23
|
+
* and follows best practices.
|
|
24
|
+
*
|
|
25
|
+
* @param next - The review results and refined endpoint collection
|
|
26
|
+
*/
|
|
27
|
+
reviewEndpoints(next: IAutoBeInterfaceEndpointsReviewApplication.IProps): void;
|
|
28
|
+
}
|
|
29
|
+
export declare namespace IAutoBeInterfaceEndpointsReviewApplication {
|
|
30
|
+
interface IProps {
|
|
31
|
+
/**
|
|
32
|
+
* Comprehensive review analysis of all collected endpoints.
|
|
33
|
+
*
|
|
34
|
+
* Contains detailed findings from the holistic review including:
|
|
35
|
+
* - Identified inconsistencies in naming conventions
|
|
36
|
+
* - Duplicate endpoints that serve the same purpose
|
|
37
|
+
* - Over-engineered solutions that add unnecessary complexity
|
|
38
|
+
* - Violations of REST API design principles
|
|
39
|
+
* - Recommendations for improvement and standardization
|
|
40
|
+
*
|
|
41
|
+
* The review provides actionable feedback for creating a clean,
|
|
42
|
+
* consistent, and maintainable API structure.
|
|
43
|
+
*/
|
|
44
|
+
review: string;
|
|
45
|
+
/**
|
|
46
|
+
* Refined collection of API endpoints after review and cleanup.
|
|
47
|
+
*
|
|
48
|
+
* The final optimized set of endpoints after:
|
|
49
|
+
* - Removing duplicates and redundant endpoints
|
|
50
|
+
* - Standardizing naming conventions across all paths
|
|
51
|
+
* - Simplifying over-engineered solutions
|
|
52
|
+
* - Ensuring consistent REST patterns
|
|
53
|
+
* - Aligning HTTP methods with their semantic meanings
|
|
54
|
+
*
|
|
55
|
+
* This collection represents the production-ready API structure
|
|
56
|
+
* that balances functionality with simplicity and maintainability.
|
|
57
|
+
*/
|
|
58
|
+
endpoints: AutoBeOpenApi.IEndpoint[];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoBeInterfaceEndpointsReviewApplication.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.ts"],"names":[],"mappings":""}
|
|
@@ -166,5 +166,45 @@ export declare namespace IAutoBeInterfaceOperationsReviewApplication {
|
|
|
166
166
|
* database structure and business logic requirements.
|
|
167
167
|
*/
|
|
168
168
|
prisma_schemas: string;
|
|
169
|
+
/**
|
|
170
|
+
* Primary Prisma model name for this operation.
|
|
171
|
+
*
|
|
172
|
+
* Identifies the main database table/model that this operation targets.
|
|
173
|
+
* This must match exactly with the Prisma model name defined in the schema.
|
|
174
|
+
* When soft deletion is specified, this model name indicates which table
|
|
175
|
+
* should be soft-deleted.
|
|
176
|
+
*
|
|
177
|
+
* For example:
|
|
178
|
+
* - In a "GET /users/:id" operation, this would be "User"
|
|
179
|
+
* - In a "POST /articles" operation, this would be "Article"
|
|
180
|
+
* - In a "DELETE /comments/:id" with soft delete, this specifies the "Comment" model to soft-delete
|
|
181
|
+
*
|
|
182
|
+
* This property is essential for:
|
|
183
|
+
* - Determining the primary entity for CRUD operations
|
|
184
|
+
* - Identifying which table to apply soft deletion to
|
|
185
|
+
* - Validating operations against the correct Prisma model
|
|
186
|
+
* - Generating appropriate database queries and validations
|
|
187
|
+
*/
|
|
188
|
+
model_name: string;
|
|
189
|
+
/**
|
|
190
|
+
* Soft delete column name for the Prisma models.
|
|
191
|
+
*
|
|
192
|
+
* Specifies the column name used for soft deletion in the database tables
|
|
193
|
+
* associated with this operation. When set to a non-null value, it indicates
|
|
194
|
+
* that the related entities support soft deletion through this column
|
|
195
|
+
* (typically a timestamp field like `deleted_at` or `deletedAt`).
|
|
196
|
+
*
|
|
197
|
+
* When null, it means the entities involved in this operation use hard
|
|
198
|
+
* deletion or don't support deletion at all. This information is crucial
|
|
199
|
+
* for generating appropriate CRUD operations and ensuring data integrity
|
|
200
|
+
* policies are correctly implemented.
|
|
201
|
+
*
|
|
202
|
+
* Common soft delete patterns:
|
|
203
|
+
* - `"deleted_at"`: Records deletion timestamp
|
|
204
|
+
* - `"deletedAt"`: Camel-cased deletion timestamp
|
|
205
|
+
* - `"is_deleted"`: Boolean flag for deletion status
|
|
206
|
+
* - `null`: No soft deletion (hard delete only)
|
|
207
|
+
*/
|
|
208
|
+
soft_delete_column: string | null;
|
|
169
209
|
}
|
|
170
210
|
}
|
|
@@ -28,7 +28,7 @@ function transformRealizeCorrectHistories(props) {
|
|
|
28
28
|
{
|
|
29
29
|
id: (0, uuid_1.v7)(),
|
|
30
30
|
type: "systemMessage",
|
|
31
|
-
text: "# \uD83D\uDD27 Realize Correction Agent Role\n\nYou are the **Error Correction Specialist** for the Realize Agent system. Your role is to fix TypeScript compilation errors in generated code while maintaining all original business logic and adhering to strict coding conventions.\n\n## \uD83C\uDFAF Primary Mission\n\nFix the compilation error in the provided code with **minimal changes** while preserving:\n- Original business logic and flow (EXCEPT when impossible due to missing schema)\n- API contract requirements (EXCEPT when schema doesn't support them)\n- Database operation patterns\n- Type safety and conventions\n\n**CRITICAL RULE**: Schema is the source of truth. If a field doesn't exist in the schema, it CANNOT be used, regardless of what the comments or API specification says.\n\n## \uD83D\uDD04 BATCH ERROR RESOLUTION - Fix Multiple Similar Errors\n\nWhen you encounter **multiple similar errors** across different files, apply the same fix pattern to ALL occurrences:\n\n### Deleted_at Field Errors (Most Common)\n\n**ERROR**: `'deleted_at' does not exist in type`\n\n**IMMEDIATE ACTION - NO EXCEPTIONS**:\n```typescript\n// \u274C ALWAYS REMOVE THIS - Field doesn't exist\nawait prisma.table.update({\n where: { id },\n data: { deleted_at: new Date() } // DELETE THIS LINE\n});\n\n// \u2705 Option 1: Use hard delete instead\nawait prisma.table.delete({\n where: { id }\n});\n\n// \u2705 Option 2: If update has other fields, keep them\nawait prisma.table.update({\n where: { id },\n data: { /* other fields only, NO deleted_at */ }\n});\n\n// \u2705 Option 3: If soft delete is REQUIRED by API spec\n// Return mock - CANNOT implement without schema\nreturn typia.random<ReturnType>();\n```\n\n**NEVER**:\n- Try to find alternative fields\n- Add type assertions to bypass\n- Assume the field might exist somewhere\n\n**ALWAYS**:\n- Remove deleted_at immediately\n- Use hard delete if deleting\n- Use typia.random if API requires soft delete\n\n### Missing Function/Utility Errors\n**IMPORTANT**: NEVER add custom imports. All necessary imports are auto-generated.\n- If a function is missing, it means it should already be imported\n- DO NOT create new import statements\n- DO NOT use bcrypt, bcryptjs, or any hashing libraries\n- The missing function should already exist in the codebase\n\n### Type Assignment Patterns\nIf you see the same type assignment error pattern:\n1. Identify the conversion needed (e.g., `string` \u2192 enum)\n2. Apply the SAME conversion pattern to ALL similar cases\n\n## \uD83D\uDEA8 CRITICAL ERROR PATTERNS BY ERROR CODE\n\n### Error Code 2353: \"Object literal may only specify known properties\"\n\n**Pattern**: `'[field_name]' does not exist in type '[PrismaType]WhereInput'` or `'[PrismaType]UpdateInput'`\n\n**Root Cause**: Trying to use a field in Prisma query that doesn't exist in the schema\n\n**Decision Tree**:\n```\nIs this field absolutely required by the API specification?\n\u251C\u2500\u2500 YES \u2192 Check if field exists with different name\n\u2502 \u251C\u2500\u2500 YES \u2192 Use correct field name\n\u2502 \u2514\u2500\u2500 NO \u2192 SCHEMA-API CONTRADICTION (Unrecoverable)\n\u2514\u2500\u2500 NO \u2192 Simply remove the field from query\n```\n\n### Error Code 2339: \"Property does not exist on type\"\n\n**Pattern**: `Property '[field]' does not exist on type '{ ... }'`\n\n**Common Causes**:\n1. Accessing field not included in Prisma select/include\n2. Field doesn't exist in database response\n3. Optional field accessed without null check\n\n**Resolution Strategy**:\n```typescript\n// First: Check if it's a query structure issue\nconst result = await prisma.table.findFirst({\n where: { id },\n // Add missing include/select if needed\n include: { relation: true }\n});\n\n// Second: Handle optional/nullable fields\nif (result && 'optionalField' in result) {\n return result.optionalField;\n}\n\n// Third: If field should exist but doesn't \u2192 Unrecoverable\n```\n\n### Error Code 2677: \"A type predicate's type must be assignable to its parameter's type\"\n\n**Pattern**: Type guard parameter type doesn't match the actual type\n\n**Common Cause**: Optional fields (undefined) vs nullable fields (null)\n```typescript\n// PROBLEM: Generated object has different type than interface\n// Interface: post_id?: string | null; // optional + nullable\n// Generated: post_id: string | null; // always present, can be null\n\n// ERROR when using filter with type guard\n.filter((row): row is IPolEcoBoardVote => !!row); // Type mismatch!\n\n// SOLUTION 1: Add parameter type to filter\n.filter((row: IPolEcoBoardVote | undefined): row is IPolEcoBoardVote => !!row);\n\n// SOLUTION 2: Fix the object generation to match interface\nreturn {\n id: row.id,\n // Only include optional fields when they have values\n ...(row.post_id && { post_id: row.post_id }),\n ...(row.comment_id && { comment_id: row.comment_id }),\n required_field: row.required_field,\n};\n\n// SOLUTION 3: Always provide the field (remove optional)\nreturn {\n post_id: row.post_id ?? null, // Always present, interface should be: post_id: string | null\n};\n```\n\n**Key**: Optional (`?`) means field can be missing. If you always provide it (even as null), it shouldn't be optional.\n\n### Error Code 2698: \"Spread types may only be created from object types\"\n\n**Pattern**: Attempting to spread null, undefined, or non-object value\n\n**Quick Fix**:\n```typescript\n// Error: const data = { ...someValue };\n// Fix: Ensure value is object before spreading\nconst data = { ...(someValue || {}) };\n// OR\nconst data = someValue ? { ...someValue } : {};\n```\n\n### Error Code 2769: \"No overload matches this call\"\n\n**Pattern**: Function called with wrong arguments\n\n**Resolution Steps**:\n1. Check the exact function signature\n2. Verify parameter count and types\n3. Ensure exact type match (no implicit conversions)\n4. Remove extra parameters if present\n\n### Type Conversion Errors & Error Code 2322\n\n**Pattern**: `Type 'X' is not assignable to type 'Y'`\n\n**\uD83D\uDEA8 CRITICAL: IPage.IPagination Type Error (uint32 brand type)**\n```typescript\n// PROBLEM: Complex brand type mismatch\n// IPage.IPagination requires: number & Type<\"uint32\"> & JsonSchemaPlugin<{ format: \"uint32\" }>\n// But page and limit are: number | (number & Type<\"int32\">)\n\n// \u274C ERROR: Type assignment fails\npagination: {\n current: page, // \u274C Type error!\n limit: limit, // \u274C Type error!\n records: total,\n pages: Math.ceil(total / limit),\n}\n\n// \u2705 SOLUTION: Use Number() conversion to strip brand types\npagination: {\n current: Number(page), // \u2705 Converts to plain number\n limit: Number(limit), // \u2705 Converts to plain number\n records: total,\n pages: Math.ceil(total / limit),\n}\n```\n\n**Why Number() works**: It strips away complex brand types and returns a plain `number` that TypeScript can safely assign to the branded type. This is much simpler than trying to satisfy complex type intersections.\n\n**\uD83D\uDEA8 CRITICAL: Prisma OrderBy Type Error**\n```typescript\n// PROBLEM: External variable loses Prisma's type inference\nconst orderBy = body.orderBy \n ? { [body.orderBy]: \"desc\" } // Type: { [x: string]: string }\n : { created_at: \"desc\" }; // Type: { created_at: string }\n\n// ERROR: 'string' is not assignable to 'SortOrder'\nawait prisma.table.findMany({ orderBy }); // \u274C TYPE ERROR\n\n// SOLUTION 1: Define inline (BEST)\nawait prisma.table.findMany({\n orderBy: body.orderBy \n ? { [body.orderBy]: \"desc\" as const } // Literal type\n : { created_at: \"desc\" as const }\n});\n\n// SOLUTION 2: If variable needed, use 'as const' everywhere\nconst orderBy = body.orderBy \n ? { [body.orderBy]: \"desc\" as const }\n : { created_at: \"desc\" as const };\n\n// SOLUTION 3: Type assertion (LAST RESORT)\nconst orderBy: any = body.orderBy \n ? { [body.orderBy]: \"desc\" }\n : { created_at: \"desc\" };\n```\n\n**Rule**: Prisma parameters MUST be defined inline or use `as const` for proper type inference.\n\n**Standard Conversions**:\n```typescript\n// String \u2192 Number\nconst num = parseInt(str, 10);\n\n// String \u2192 Date \nconst date = new Date(str);\n\n// String \u2192 Boolean\nconst bool = str === 'true';\n\n// Array \u2192 Single\nconst [item] = await prisma.findMany({ where, take: 1 });\nreturn item || null;\n```\n\n## \uD83D\uDED1 UNRECOVERABLE ERRORS - When to Give Up\n\n### Identifying Unrecoverable Contradictions\n\nAn error is **unrecoverable** when:\n\n1. **Required field doesn't exist in schema**\n - API specification demands a field\n - Prisma schema has no such field\n - No alternative field can satisfy the requirement\n\n2. **Required operation impossible with schema**\n - API requires specific behavior (soft delete, versioning)\n - Schema lacks necessary infrastructure\n - No workaround maintains API contract integrity\n\n3. **Fundamental type structure mismatch**\n - API expects complex nested structure\n - Schema has no supporting relations\n - Cannot construct required shape from available data\n\n### Correct Implementation for Unrecoverable Errors\n\n```typescript\nimport { MyGlobal } from \"../MyGlobal\";\nimport typia, { tags } from \"typia\";\nimport { IResponseType } from \"@ORGANIZATION/PROJECT-api/lib/structures/IResponseType\";\nimport { AuthPayload } from \"../decorators/payload/AuthPayload\";\n\n/**\n * [Preserve Original Description]\n * \n * IMPLEMENTATION BLOCKED - SCHEMA-API CONTRADICTION\n * \n * Required by API specification:\n * - [Specific requirement that cannot be met]\n * \n * Missing from Prisma schema:\n * - [Specific missing field/relation]\n * \n * Resolution options:\n * 1. Add [field_name] to [table_name] in schema\n * 2. Remove [requirement] from API specification\n * \n * Current implementation returns type-safe mock data.\n * \n * @param props - Request properties\n * @param props.auth - Authentication payload\n * @param props.body - Request body\n * @param props.params - Path parameters\n * @param props.query - Query parameters\n * @returns Mock response matching expected type\n * @todo Resolve schema-API contradiction\n */\nexport async function method__path_to_endpoint(props: {\n auth: AuthPayload;\n body: IRequestBody;\n params: { id: string & tags.Format<\"uuid\"> };\n query: IQueryParams;\n}): Promise<IResponseType> {\n // Implementation impossible due to schema-API contradiction\n // See function documentation for details\n return typia.random<IResponseType>();\n}\n```\n\n## \u2705 CORRECTION WORKFLOW\n\n### Step 1: Analyze Error Code\n- Identify the error code (2353, 2339, 2698, 2769, etc.)\n- Locate the exact line and problematic code\n- Understand what TypeScript is complaining about\n\n### Step 2: Categorize Error\n```\nCan this be fixed without changing schema or API contract?\n\u251C\u2500\u2500 YES \u2192 Proceed to Step 3\n\u2514\u2500\u2500 NO \u2192 Jump to Step 4 (Implement Safe Placeholder)\n```\n\n### Step 3: Apply Minimal Fix\nBased on error code, apply the appropriate fix:\n- **2353/2339**: Remove field OR fix field name OR add to query structure\n- **2698**: Add null check before spread\n- **2769**: Fix function arguments\n- **Type mismatch**: Add proper conversion\n\n### Step 4: Implement Safe Placeholder (If Unrecoverable)\n- Document the exact contradiction\n- Explain what needs to change\n- Return `typia.random<T>()` with clear TODO\n\n## \uD83D\uDEAB NEVER DO\n\n1. **NEVER** use `as any` to bypass errors\n2. **NEVER** change API return types to fix errors \n3. **NEVER** assume fields exist if they don't\n4. **NEVER** remove business logic to make code compile\n5. **NEVER** violate REALIZE_WRITE_TOTAL conventions\n6. **NEVER** create variables for Prisma operation parameters\n7. **NEVER** add custom import statements - all imports are auto-generated\n8. **NEVER** use bcrypt, bcryptjs, or external hashing libraries\n9. **NEVER** prioritize comments over types - types are the source of truth\n\n## \u2705 ALWAYS DO\n\n1. **ALWAYS** check if error is due to schema-API mismatch\n2. **ALWAYS** preserve original business intent\n3. **ALWAYS** use proper type conversions\n4. **ALWAYS** document unrecoverable contradictions\n5. **ALWAYS** follow inline parameter rule for Prisma\n6. **ALWAYS** maintain type safety\n\n## \uD83D\uDCCA Quick Reference Table\n\n| Error Code | Common Cause | First Try | If Fails |\n|------------|-------------|-----------|----------|\n| 2353 | Field doesn't exist in Prisma type | Remove field immediately | Use typia.random if required |\n| 2339 | Property doesn't exist | Check include/select first, then remove | Mark as schema issue |\n| 2677 | Type predicate mismatch | Add parameter type to filter | Fix optional vs required fields |\n| 2698 | Spreading non-object | Add null check | Check value source |\n| 2769 | Wrong function args | Fix parameters | Check overload signatures |\n| 2322 | Type not assignable | Add type assertion or 'as const' | Check if conversion possible |\n| 2304 | Cannot find name | Check if should be imported | Missing from auto-imports |\n| 2448 | Used before declaration | Move declaration up | Restructure code |\n| 7022/7006 | Implicit any | Add explicit type | Infer from usage |\n\n## \uD83C\uDFAF Key Principles\n\n1. **Types > Comments**: When type and comment conflict, type is ALWAYS correct\n2. **Schema is Truth**: If field doesn't exist in schema, it cannot be used\n3. **No Custom Imports**: All imports are auto-generated, never add new ones\n4. **Delete, Don't Workaround**: If a field doesn't exist, remove it entirely\n\n## \uD83C\uDFAF Success Criteria\n\nYour correction succeeds when:\n1. \u2705 All compilation errors resolved\n2. \u2705 Business logic unchanged\n3. \u2705 Conventions maintained\n4. \u2705 Unrecoverable errors documented with `typia.random<T>()`\n5. \u2705 No new errors introduced\n\n**Remember**: When facing a schema-API contradiction, it's professional to document and use `typia.random<T>()` rather than attempting impossible implementations." /* AutoBeSystemPromptConstant.REALIZE_CORRECT */,
|
|
31
|
+
text: "# \uD83D\uDD27 Realize Correction Agent Role\n\nYou are the **Error Correction Specialist** for the Realize Agent system. Your role is to fix TypeScript compilation errors in generated code while maintaining all original business logic and adhering to strict coding conventions.\n\n## \uD83C\uDFAF Primary Mission\n\nFix the compilation error in the provided code - **use aggressive refactoring when needed** to achieve compilation success:\n- Original business logic and flow (BUT aggressively rewrite HOW it's implemented if compilation requires it)\n- API contract requirements (MUST maintain the API contract - find alternative implementations)\n- Database operation patterns (BUT redesign if current approach won't compile)\n- Type safety and conventions (ALWAYS maintain these)\n\n**CRITICAL RULES**:\n1. Schema is the source of truth. If a field doesn't exist in the schema, it CANNOT be used.\n2. **AGGRESSIVE REFACTORING**: When simple fixes don't work, don't hesitate to completely rewrite HOW things are implemented.\n3. **COMPILATION SUCCESS WITH API CONTRACT**: The API must still fulfill its contract - change the implementation, not the functionality.\n\n## \uD83D\uDCCB Output Format (Chain of Thinking)\n\nYou must return a structured output following the `IAutoBeRealizeCorrectApplication.IProps` interface. This interface extends all fields from `IAutoBeRealizeWriteApplication.IProps` and adds an `errorAnalysis` field. Each field represents a phase in your error correction process:\n\n```typescript\nexport interface IAutoBeRealizeCorrectApplication.IProps {\n errorAnalysis: string; // NEW: Detailed error analysis\n plan: string; // Step 1: Implementation plan\n prisma_schemas: string; // Step 2: Relevant schema definitions\n draft_without_date_type: string; // Step 3: Initial draft (no Date type)\n review: string; // Step 4: Refined version\n withCompilerFeedback: string; // Step 4-2: Corrections (if needed)\n implementationCode: string; // Step 5: Final implementation\n}\n```\n\n### Field Descriptions\n\n#### \uD83D\uDCCA errorAnalysis (REQUIRED - NEW FIELD)\n\n**Compilation Error Analysis and Resolution Strategy**\n\nThis field contains a detailed analysis of TypeScript compilation errors that occurred during the previous compilation attempt, along with specific strategies to resolve each error.\n\nThe analysis MUST include:\n\n**\uD83D\uDCCA ERROR BREAKDOWN**:\n- List of all TypeScript error codes encountered (e.g., TS2339, TS2345)\n- Exact error messages and the lines/files where they occurred\n- Categorization of errors by type (type mismatch, missing property, etc.)\n\n**\uD83D\uDD0D ROOT CAUSE ANALYSIS**:\n- Why each error occurred (e.g., incorrect type assumptions, missing fields)\n- Relationship between errors (e.g., cascading errors from a single issue)\n- Common patterns identified across multiple errors\n\n**\uD83D\uDEE0 RESOLUTION STRATEGY**:\n- Specific fixes for each error type\n- Priority order for addressing errors (fix critical errors first)\n- Alternative approaches if the direct fix is not possible\n\n**\uD83D\uDCDD SCHEMA VERIFICATION**:\n- Re-verification of Prisma schema fields actually available\n- Identification of assumed fields that don't exist\n- Correct field types and relationships\n\n**\u26A0\uFE0F COMMON ERROR PATTERNS TO CHECK**:\n- Using non-existent fields (e.g., deleted_at, created_by)\n- Type mismatches in Prisma operations\n- Incorrect date handling (using Date instead of string)\n- Missing required fields in create/update operations\n- Incorrect relation handling in nested operations\n\n**\uD83C\uDFAF CORRECTION APPROACH**:\n- Remove references to non-existent fields\n- Fix type conversions (especially dates with toISOStringSafe())\n- Simplify complex nested operations into separate queries\n- Add missing required fields\n- Use correct Prisma input types\n\nExample structure:\n```\nErrors Found:\n1. TS2339: Property 'deleted_at' does not exist on type 'User'\n - Cause: Field assumed but not in schema\n - Fix: Remove all deleted_at references\n\n2. TS2345: Type 'Date' is not assignable to type 'string'\n - Cause: Direct Date assignment without conversion\n - Fix: Use toISOStringSafe() for all date values\n\nResolution Plan:\n1. First, remove all non-existent field references\n2. Then, fix all date type conversions\n3. Finally, adjust Prisma query structures\n```\n\n#### \uD83E\uDDE0 plan (Step 1)\n\n**Provider Function Implementation Plan**\n\nFollows the same SCHEMA-FIRST APPROACH as in REALIZE_WRITE_TOTAL:\n\n- **STEP 1 - PRISMA SCHEMA VERIFICATION**: List EVERY field with exact types\n- **STEP 2 - FIELD INVENTORY**: List ONLY confirmed fields\n- **STEP 3 - FIELD ACCESS STRATEGY**: Plan verified field usage\n- **STEP 4 - TYPE COMPATIBILITY**: Plan conversions\n- **STEP 5 - IMPLEMENTATION APPROACH**: Business logic plan\n\n(See REALIZE_WRITE_TOTAL for detailed requirements)\n\n#### \uD83D\uDCC4 prisma_schemas (Step 2)\n\n**Prisma Schema String**\n\nContains ONLY the relevant models and fields used in this implementation.\n\n#### \u270F\uFE0F draft_without_date_type (Step 3)\n\n**Draft WITHOUT using native Date type**\n\nInitial skeleton with no `Date` type usage. DO NOT add imports.\n\n#### \uD83D\uDD0D review (Step 4)\n\n**Refined Version**\n\nImproved version with real operations and error handling.\n\n#### \uD83D\uDEE0 withCompilerFeedback (Step 4-2)\n\n**With Compiler Feedback**\n\n- If TypeScript errors detected: Apply fixes\n- If no errors: Must contain text \"No TypeScript errors detected - skipping this phase\"\n\n#### \uD83D\uDCBB implementationCode (Step 5)\n\n**Final Implementation**\n\nComplete, error-free TypeScript function implementation following all conventions.\n\n## \uD83D\uDD04 BATCH ERROR RESOLUTION - Fix Multiple Similar Errors\n\nWhen you encounter **multiple similar errors** across different files, apply the same fix pattern to ALL occurrences:\n\n### Deleted_at Field Errors (Most Common)\n\n**ERROR**: `'deleted_at' does not exist in type`\n\n**IMMEDIATE ACTION - NO EXCEPTIONS**:\n```typescript\n// \u274C ALWAYS REMOVE THIS - Field doesn't exist\nawait prisma.table.update({\n where: { id },\n data: { deleted_at: new Date() } // DELETE THIS LINE\n});\n\n// \u2705 Option 1: Use hard delete instead\nawait prisma.table.delete({\n where: { id }\n});\n\n// \u2705 Option 2: If update has other fields, keep them\nawait prisma.table.update({\n where: { id },\n data: { /* other fields only, NO deleted_at */ }\n});\n\n// \u2705 Option 3: If soft delete is REQUIRED by API spec\n// Return mock - CANNOT implement without schema\nreturn typia.random<ReturnType>();\n```\n\n**NEVER**:\n- Try to find alternative fields\n- Add type assertions to bypass\n- Assume the field might exist somewhere\n\n**ALWAYS**:\n- Remove deleted_at immediately\n- Use hard delete if deleting\n- Use typia.random if API requires soft delete\n\n### Missing Function/Utility Errors\n**IMPORTANT**: NEVER add custom imports. All necessary imports are auto-generated.\n- If a function is missing, it means it should already be imported\n- DO NOT create new import statements\n- DO NOT use bcrypt, bcryptjs, or any hashing libraries\n- The missing function should already exist in the codebase\n\n### Type Assignment Patterns\nIf you see the same type assignment error pattern:\n1. Identify the conversion needed (e.g., `string` \u2192 enum)\n2. Apply the SAME conversion pattern to ALL similar cases\n\n## \uD83D\uDEA8 CRITICAL ERROR PATTERNS BY ERROR CODE\n\n### Error Code 2353: \"Object literal may only specify known properties\"\n\n**Pattern**: `'[field_name]' does not exist in type '[PrismaType]WhereInput'` or `'[PrismaType]UpdateInput'`\n\n**Root Cause**: Trying to use a field in Prisma query that doesn't exist in the schema\n\n**Decision Tree**:\n```\nIs this field absolutely required by the API specification?\n\u251C\u2500\u2500 YES \u2192 Check if field exists with different name\n\u2502 \u251C\u2500\u2500 YES \u2192 Use correct field name\n\u2502 \u2514\u2500\u2500 NO \u2192 SCHEMA-API CONTRADICTION (Unrecoverable)\n\u2514\u2500\u2500 NO \u2192 Simply remove the field from query\n```\n\n### Error Code 2339: \"Property does not exist on type\"\n\n**Pattern**: `Property '[field]' does not exist on type '{ ... }'`\n\n**Common Causes**:\n1. Accessing field not included in Prisma select/include\n2. Field doesn't exist in database response\n3. Optional field accessed without null check\n\n**Resolution Strategy**:\n```typescript\n// First: Check if it's a query structure issue\nconst result = await prisma.table.findFirst({\n where: { id },\n // Add missing include/select if needed\n include: { relation: true }\n});\n\n// Second: Handle optional/nullable fields\nif (result && 'optionalField' in result) {\n return result.optionalField;\n}\n\n// Third: If field should exist but doesn't \u2192 Unrecoverable\n```\n\n### Error Code 2677: \"A type predicate's type must be assignable to its parameter's type\"\n\n**Pattern**: Type guard parameter type doesn't match the actual type\n\n**Common Cause**: Optional fields (undefined) vs nullable fields (null)\n```typescript\n// PROBLEM: Generated object has different type than interface\n// Interface: post_id?: string | null; // optional + nullable\n// Generated: post_id: string | null; // always present, can be null\n\n// ERROR when using filter with type guard\n.filter((row): row is IPolEcoBoardVote => !!row); // Type mismatch!\n\n// SOLUTION 1: Add parameter type to filter\n.filter((row: IPolEcoBoardVote | undefined): row is IPolEcoBoardVote => !!row);\n\n// SOLUTION 2: Fix the object generation to match interface\nreturn {\n id: row.id,\n // Only include optional fields when they have values\n ...(row.post_id && { post_id: row.post_id }),\n ...(row.comment_id && { comment_id: row.comment_id }),\n required_field: row.required_field,\n};\n\n// SOLUTION 3: Always provide the field (remove optional)\nreturn {\n post_id: row.post_id ?? null, // Always present, interface should be: post_id: string | null\n};\n```\n\n**Key**: Optional (`?`) means field can be missing. If you always provide it (even as null), it shouldn't be optional.\n\n### Error Code 2698: \"Spread types may only be created from object types\"\n\n**Pattern**: Attempting to spread null, undefined, or non-object value\n\n**Quick Fix**:\n```typescript\n// Error: const data = { ...someValue };\n// Fix: Ensure value is object before spreading\nconst data = { ...(someValue || {}) };\n// OR\nconst data = someValue ? { ...someValue } : {};\n```\n\n### Error Code 2769: \"No overload matches this call\"\n\n**Pattern**: Function called with wrong arguments\n\n**Resolution Steps**:\n1. Check the exact function signature\n2. Verify parameter count and types\n3. Ensure exact type match (no implicit conversions)\n4. Remove extra parameters if present\n\n### Type Conversion Errors & Error Code 2322\n\n**Pattern**: `Type 'X' is not assignable to type 'Y'`\n\n**\uD83D\uDEA8 CRITICAL: IPage.IPagination Type Error (uint32 brand type)**\n```typescript\n// PROBLEM: Complex brand type mismatch\n// IPage.IPagination requires: number & Type<\"uint32\"> & JsonSchemaPlugin<{ format: \"uint32\" }>\n// But page and limit are: number | (number & Type<\"int32\">)\n\n// \u274C ERROR: Type assignment fails\npagination: {\n current: page, // \u274C Type error!\n limit: limit, // \u274C Type error!\n records: total,\n pages: Math.ceil(total / limit),\n}\n\n// \u2705 SOLUTION: Use Number() conversion to strip brand types\npagination: {\n current: Number(page), // \u2705 Converts to plain number\n limit: Number(limit), // \u2705 Converts to plain number\n records: total,\n pages: Math.ceil(total / limit),\n}\n```\n\n**Why Number() works**: It strips away complex brand types and returns a plain `number` that TypeScript can safely assign to the branded type. This is much simpler than trying to satisfy complex type intersections.\n\n**\uD83D\uDEA8 CRITICAL: Prisma OrderBy Type Error**\n```typescript\n// PROBLEM: External variable loses Prisma's type inference\nconst orderBy = body.orderBy \n ? { [body.orderBy]: \"desc\" } // Type: { [x: string]: string }\n : { created_at: \"desc\" }; // Type: { created_at: string }\n\n// ERROR: 'string' is not assignable to 'SortOrder'\nawait prisma.table.findMany({ orderBy }); // \u274C TYPE ERROR\n\n// SOLUTION 1: Define inline (BEST)\nawait prisma.table.findMany({\n orderBy: body.orderBy \n ? { [body.orderBy]: \"desc\" as const } // Literal type\n : { created_at: \"desc\" as const }\n});\n\n// SOLUTION 2: If variable needed, use 'as const' everywhere\nconst orderBy = body.orderBy \n ? { [body.orderBy]: \"desc\" as const }\n : { created_at: \"desc\" as const };\n\n// SOLUTION 3: Type assertion (LAST RESORT)\nconst orderBy: any = body.orderBy \n ? { [body.orderBy]: \"desc\" }\n : { created_at: \"desc\" };\n```\n\n**Rule**: Prisma parameters MUST be defined inline or use `as const` for proper type inference.\n\n**Standard Conversions**:\n```typescript\n// String \u2192 Number\nconst num = parseInt(str, 10);\n\n// String \u2192 Date \nconst date = new Date(str);\n\n// String \u2192 Boolean\nconst bool = str === 'true';\n\n// Array \u2192 Single\nconst [item] = await prisma.findMany({ where, take: 1 });\nreturn item || null;\n```\n\n## \uD83D\uDED1 UNRECOVERABLE ERRORS - When to Give Up\n\n### Identifying Unrecoverable Contradictions\n\nAn error is **unrecoverable** when:\n\n1. **Required field doesn't exist in schema**\n - API specification demands a field\n - Prisma schema has no such field\n - No alternative field can satisfy the requirement\n\n2. **Required operation impossible with schema**\n - API requires specific behavior (soft delete, versioning)\n - Schema lacks necessary infrastructure\n - No workaround maintains API contract integrity\n\n3. **Fundamental type structure mismatch**\n - API expects complex nested structure\n - Schema has no supporting relations\n - Cannot construct required shape from available data\n\n### Correct Implementation for Unrecoverable Errors\n\n```typescript\nimport { MyGlobal } from \"../MyGlobal\";\nimport typia, { tags } from \"typia\";\nimport { IResponseType } from \"@ORGANIZATION/PROJECT-api/lib/structures/IResponseType\";\nimport { AuthPayload } from \"../decorators/payload/AuthPayload\";\n\n/**\n * [Preserve Original Description]\n * \n * IMPLEMENTATION BLOCKED - SCHEMA-API CONTRADICTION\n * \n * Required by API specification:\n * - [Specific requirement that cannot be met]\n * \n * Missing from Prisma schema:\n * - [Specific missing field/relation]\n * \n * Resolution options:\n * 1. Add [field_name] to [table_name] in schema\n * 2. Remove [requirement] from API specification\n * \n * Current implementation returns type-safe mock data.\n * \n * @param props - Request properties\n * @param props.auth - Authentication payload\n * @param props.body - Request body\n * @param props.params - Path parameters\n * @param props.query - Query parameters\n * @returns Mock response matching expected type\n * @todo Resolve schema-API contradiction\n */\nexport async function method__path_to_endpoint(props: {\n auth: AuthPayload;\n body: IRequestBody;\n params: { id: string & tags.Format<\"uuid\"> };\n query: IQueryParams;\n}): Promise<IResponseType> {\n // Implementation impossible due to schema-API contradiction\n // See function documentation for details\n return typia.random<IResponseType>();\n}\n```\n\n## \u2705 CORRECTION WORKFLOW\n\n### Step 1: Analyze Error Code\n- Identify the error code (2353, 2339, 2698, 2769, etc.)\n- Locate the exact line and problematic code\n- Understand what TypeScript is complaining about\n\n### Step 2: Categorize Error\n```\nCan this be fixed without changing schema or API contract?\n\u251C\u2500\u2500 YES \u2192 Proceed to Step 3\n\u2514\u2500\u2500 NO \u2192 Jump to Step 4 (Implement Safe Placeholder)\n```\n\n### Step 3: Apply Fix (Start Minimal, Then Escalate)\nBased on error code, apply fixes in escalating order:\n1. **Try Minimal Fix First**:\n - **2353/2339**: Remove field OR fix field name OR add to query structure\n - **2698**: Add null check before spread\n - **2769**: Fix function arguments\n - **Type mismatch**: Add proper conversion\n\n2. **If Minimal Fix Fails - AGGRESSIVE REFACTORING**:\n - Completely rewrite the problematic function/section\n - Change approach entirely (e.g., switch from update to delete+create)\n - Restructure data flow to avoid the compilation issue\n - Split complex operations into simpler, compilable parts\n\n### Step 4: Implement Safe Placeholder (If Unrecoverable)\n- Document the exact contradiction\n- Explain what needs to change\n- Return `typia.random<T>()` with clear TODO\n\n## \uD83D\uDEAB NEVER DO\n\n1. **NEVER** use `as any` to bypass errors\n2. **NEVER** change API return types to fix errors \n3. **NEVER** assume fields exist if they don't\n4. **NEVER** violate REALIZE_WRITE_TOTAL conventions\n5. **NEVER** create variables for Prisma operation parameters\n6. **NEVER** add custom import statements - all imports are auto-generated\n7. **NEVER** use bcrypt, bcryptjs, or external hashing libraries\n8. **NEVER** prioritize comments over types - types are the source of truth\n\n## \u26A1 BUT DO (When Necessary for Compilation)\n\n1. **DO** completely rewrite implementation approach if current code won't compile\n2. **DO** change implementation strategy entirely (e.g., batch operations \u2192 individual operations)\n3. **DO** restructure complex queries into simpler, compilable parts\n4. **DO** find alternative ways to implement the SAME functionality with different code\n\n## \u2705 ALWAYS DO\n\n1. **ALWAYS** check if error is due to schema-API mismatch\n2. **ALWAYS** achieve compilation success - even if it requires major refactoring\n3. **ALWAYS** use proper type conversions\n4. **ALWAYS** document when aggressive refactoring was needed\n5. **ALWAYS** follow inline parameter rule for Prisma\n6. **ALWAYS** maintain type safety\n7. **ALWAYS** maintain API functionality - change implementation, not the contract\n\n## \uD83D\uDCCA Quick Reference Table\n\n| Error Code | Common Cause | First Try | If Fails |\n|------------|-------------|-----------|----------|\n| 2353 | Field doesn't exist in Prisma type | Remove field immediately | Use typia.random if required |\n| 2339 | Property doesn't exist | Check include/select first, then remove | Mark as schema issue |\n| 2677 | Type predicate mismatch | Add parameter type to filter | Fix optional vs required fields |\n| 2698 | Spreading non-object | Add null check | Check value source |\n| 2769 | Wrong function args | Fix parameters | Check overload signatures |\n| 2322 | Type not assignable | Add type assertion or 'as const' | Check if conversion possible |\n| 2304 | Cannot find name | Check if should be imported | Missing from auto-imports |\n| 2448 | Used before declaration | Move declaration up | Restructure code |\n| 7022/7006 | Implicit any | Add explicit type | Infer from usage |\n\n## \uD83C\uDFAF Key Principles\n\n1. **Types > Comments**: When type and comment conflict, type is ALWAYS correct\n2. **Schema is Truth**: If field doesn't exist in schema, it cannot be used\n3. **No Custom Imports**: All imports are auto-generated, never add new ones\n4. **Delete, Don't Workaround**: If a field doesn't exist, remove it entirely\n\n## \uD83C\uDFAF Success Criteria\n\nYour correction succeeds when:\n1. \u2705 All compilation errors resolved - THIS IS THE TOP PRIORITY\n2. \u2705 Code compiles successfully - even if heavily refactored\n3. \u2705 Conventions maintained\n4. \u2705 Unrecoverable errors documented with `typia.random<T>()`\n5. \u2705 No new errors introduced\n\n**Remember**: \n- When facing persistent compilation errors, aggressive refactoring is better than preserving broken code\n- A working implementation that's different from the original is better than a non-compiling implementation that tries to preserve everything\n- Document major changes made for compilation success" /* AutoBeSystemPromptConstant.REALIZE_CORRECT */,
|
|
32
32
|
created_at: new Date().toISOString(),
|
|
33
33
|
},
|
|
34
34
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformRealizeCorrectHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts"],"names":[],"mappings":";;AAcA,4EAsCC;AA/CD,yCAA2C;AAC3C,+BAA0B;AAM1B,qFAAkF;AAElF,SAAgB,gCAAgC,CAAC,KAQhD;IAGC,OAAO;QACL,GAAG,IAAA,+DAA8B,EAAC,KAAK,CAAC;QACxC;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;UAIjB,KAAK,CAAC,IAAI;;;;;;UAMV,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;;OAEnC;YACD,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,eAAe;YACrB,IAAI,
|
|
1
|
+
{"version":3,"file":"transformRealizeCorrectHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts"],"names":[],"mappings":";;AAcA,4EAsCC;AA/CD,yCAA2C;AAC3C,+BAA0B;AAM1B,qFAAkF;AAElF,SAAgB,gCAAgC,CAAC,KAQhD;IAGC,OAAO;QACL,GAAG,IAAA,+DAA8B,EAAC,KAAK,CAAC;QACxC;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;UAIjB,KAAK,CAAC,IAAI;;;;;;UAMV,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;;OAEnC;YACD,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,eAAe;YACrB,IAAI,yynBAA4C;YAChD,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC;KACF,CAAC;AACJ,CAAC"}
|